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

Refactor: ArgumentParser and defaults #1352

Closed
Molkree opened this issue Aug 20, 2021 · 1 comment · Fixed by #1560
Closed

Refactor: ArgumentParser and defaults #1352

Molkree opened this issue Aug 20, 2021 · 1 comment · Fixed by #1560
Labels
enhancement New feature or request
Milestone

Comments

@Molkree
Copy link
Contributor

Molkree commented Aug 20, 2021

As mentioned in #1333 (comment) and #1340 (comment).

cli.py and helper_script.py use ArgumentParser and that's great, however they both keep default arguments in the separate dict instead of specifying them right when adding an argument to the parser. This reduces locality and prevents us from showing default in the help string with %(default)s.

I was told this is due to the fact that CLI supports reading config from file however I believe this should still work nicely with config files if you replace defaults dict with something like defaults = {key: parser.get_default(key) for key in vars(args)}.

@terriko terriko added the enhancement New feature or request label Aug 26, 2021
@terriko terriko added this to the future milestone Oct 13, 2021
@XDRAGON2002
Copy link
Contributor

Opened PR #1560 that closes this issue.

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

Successfully merging a pull request may close this issue.

3 participants