Skip to content

Is there a way to stop arguments from being interpreted as flags? #22

@Mrfiregem

Description

@Mrfiregem

Most cli programs allow specifying -- to make it so any arguments to the right of it are not treated as flags, even if they take the form of -a or --arg. Is there any way to implement this currently with argparse? For example:

# '--arg2' should be treated as a positional argument after '--'
./my_command -ab --arg2 -- arg1 --arg2 arg3

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions