Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config files render various errors in combination with default values #260

Open
ftrofin opened this issue Dec 16, 2021 · 1 comment
Open

Comments

@ftrofin
Copy link

ftrofin commented Dec 16, 2021

This is related to #245 I think.
I'm seeing the same error when I specify a config file. In my case I have a boolean flag that has a default value:

parser_create.add_argument('-r', '--recurse', action=argparse.BooleanOptionalAction, default=True,

I'm also using subcommands (parser_create above was created by parser_create = subparsers.add_parser('create')) and they don't work well at all with ConfigArgParse.
I've tried both config file formats, I get different errors with each of them. Interop with the config files was what made ConfigArgParse attractive but it seems that this doesn't really work in more real-world scenarios. I'd be happy to provide more details if you need them.

@mauvilsa
Copy link

@ftrofin maybe you might want to try out jsonargparse. It is very actively maintained and has many more features that you might find useful. A thing to note is that subcommands work a bit different that in argparse, see the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants