Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentParser.add_argument prompt for value #94

Open
Jaymon opened this issue Aug 11, 2024 · 0 comments
Open

ArgumentParser.add_argument prompt for value #94

Jaymon opened this issue Aug 11, 2024 · 0 comments

Comments

@Jaymon
Copy link
Owner

Jaymon commented Aug 11, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant