Skip to content

Support flag-only arguments #221

@MaxG87

Description

@MaxG87

I would like to have arguments that do not accept any value. Thus,

./my-script.py --flag

should work, but

./my-script.py --flag SomeValue

should not. In argparse this can be achieved by

parser.add_argument("--flag", action="store_true")

but I do not know how to achieve that in python-fire.

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