Skip to content

Support for positional arguments #11

@aspitarl

Description

@aspitarl

I have a script with a required argument 'datestr' that I usually provide as a positional argument

parser.add_argument('datestr', type=str, help='Provide a date to process in the format YYYY-MM-DD')

This does not work with PromptParser giving error: the following arguments are required: datestr. However, this does work when changing to an 'optional' argument.

parser.add_argument('-d', '--datestr', type=str, help='Provide a date to process in the format YYYY-MM-DD')

Where it works as expected.

It seems like the behavior of both arguments should be the same with PromptParser. Unless I'm missing something, I'm guessing this is just not implemented yet. This seems like it would be useful as positional arguments are usually required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions