Skip to content

ArgumentParser.add_argument prompt for value #94

@Jaymon

Description

@Jaymon

It would be nice to be able to prompt for a missing value, I think this would be easiest using an action. I would need to register the action in the initialize method:

self.register('action', 'prompt', PromptAction)

And then I can use it:

@arg("--foo", action="prompt")

Where the missing argument can take a callback or something. Likewise, maybe:

@arg("--foo", missing=prompt)

Would say that the foo value should prompt for a value? Or maybe the action should be prompt_if_missing or something like that.

Originally posted by @Jaymon in #77 (comment)

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