Skip to content

Refactor: ArgumentParser and defaults #1352

@Molkree

Description

@Molkree

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)}.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions