-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Args::Flag: Add required attribute
#14087
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -202,8 +202,12 @@ public: | |
| Strings labels; | ||
| Handler handler; | ||
| CompleterClosure completer; | ||
| bool required = false; | ||
|
|
||
| std::optional<ExperimentalFeature> experimentalFeature; | ||
|
|
||
| // FIXME: this should be private, but that breaks designated initializers. | ||
| size_t timesUsed = 0; | ||
|
Comment on lines
+208
to
+210
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's really ugly that
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I would prefer that too, thanks for catching @xokdvium
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it's a problem since |
||
| }; | ||
|
|
||
| protected: | ||
|
|
@@ -283,6 +287,8 @@ protected: | |
|
|
||
| StringSet hiddenCategories; | ||
|
|
||
| virtual void checkArgs(); | ||
|
|
||
| /** | ||
| * Called after all command line flags before the first non-flag | ||
| * argument (if any) have been processed. | ||
|
|
@@ -428,6 +434,8 @@ public: | |
| protected: | ||
| std::string commandName = ""; | ||
| bool aliasUsed = false; | ||
|
|
||
| void checkArgs() override; | ||
| }; | ||
|
|
||
| Strings argvToStrings(int argc, char ** argv); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we list multiple such flags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there can be multiple
requiredflags.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I mean collect them all and throw error with all of them