ulfalizer / Kconfiglib

A flexible Python 2/3 Kconfig implementation and library
ISC License
448 stars 160 forks source link

Boolean default not taken if written after help #124

Open DonBrus opened 1 year ago

DonBrus commented 1 year ago

Hi,

I recently encountered an error when trying to setup a default value for boolean options, whenever I also include a help instruction within the menu.

The following works in setting the default value correctly

menu "General options"
    config Kconf_Options_Foo
        bool "This is the foo option"
        default y
endmenu

working-bool-default

This, in turn, does not work:

menu "General options"
    config Kconf_Options_Foo
        bool "This is the foo option"
                help "This setups foo, which causes baz"
        default y
endmenu

non-working-bool-default

Inverting default and help prevents parsing of KConfig file

menu "General options"
    config Kconf_Options_Foo
        bool "This is the foo option"
                default y
                help "This setups foo, which causes baz"
endmenu

produces

menuconfig.py: error: expected 'endmenu' at end of 'Kconfig'

I'm using the latest pip package (14.1.0). Is this expected behavior? Am I doing something wrong?

Btw I've seen issue #121 however it's not clear to me whether a takeover is already taking place or not; if so, I'd like to report this issue over to the new repo, if any exist.

Thanks!