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

Flags optional arguments #146

Open
steinybot opened this issue Aug 12, 2024 · 1 comment
Open

Flags optional arguments #146

steinybot opened this issue Aug 12, 2024 · 1 comment

Comments

@steinybot
Copy link

Is it possible to have a flag with optional arguments?

I want to be able to pass --mirror and --mirror <path>. Either mirror is missing, present without a value, or present with a value.

@lihaoyi
Copy link
Member

lihaoyi commented Aug 14, 2024

Currently it is not possible. It might be possible to implement, with some caveats (e.g. <path> would not be able to start with - or --, <path> would take precedence over mainargs.Leftover), but those may be OK tradeoffs for the convenience

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

2 participants