Skip to content

Abbreviated root options break sub-command argument registration #212

Description

@galjos

argparse accepts any unambiguous prefix of a long option, but _detect_command in the lazy dispatch only matches exact spellings:

$ pqanalysis --logging DEBUG rdf input.in
pqanalysis: error: unrecognized arguments: input.in
$ pqanalysis --logging DEBUG rdf
AttributeError: 'Namespace' object has no attribute 'export_files'

The abbreviation makes command detection fail, the sub-parser registers zero arguments, and dispatch proceeds anyway on an empty namespace. Introduced with the lazy dispatch in #171.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions