-
Notifications
You must be signed in to change notification settings - Fork 354
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
Relaxed option naming #627
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TODO
|
phlptp
force-pushed
the
relaxedOptionNaming
branch
3 times, most recently
from
July 30, 2021 23:05
eb47a61
to
32cdab3
Compare
phlptp
force-pushed
the
relaxedOptionNaming
branch
from
July 31, 2021 00:32
2e304ac
to
08756e9
Compare
Added a validator for group_names, aliases, and option group names. But not app names. App names can still have new lines, so it is possible to get a subcommand with a new line but not easy. Should we restrict this as well? |
henryiii
reviewed
Aug 11, 2021
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
github-actions
bot
added
the
needs changelog
Hasn't been added to the changelog yet
label
Aug 23, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If merged this pull request will relax the restrictions on option naming and subcommand naming.
Allowing inclusion of all characters except
starting with:
-
since we need to recognize-
and--
as different options and--
has some special meaning\n
since that would cause all sorts of chaos with the formatters and other things!
used as a special character for setting default values"-- input, input"
would be adding an extra space accidentally, But if space were allowed this would read fine as a single almost impossible to use option.and anywhere in the option
\n
same as above=
, and:
they are fine as a first character but after that they are used as a value separator so can't be allowed in an option{
{}
is used to indicate default values"--input input"
would be forgetting a comma to separate an option from the positional. But if space were allowed this would read fine as a single almost impossible to use option.this will address #580
also allow lots of amusing things like
--:)
as an optionA couple questions in #592 we talked about adding a check on group_names and a few other things. particularly in regard to newlines. I need to do that yet.
But in regard to subcommands through the
add_subcommand
I am inclined to leave the check for spaces in the subcommand name in place. The reason has to do with error catching. Most subcommand names don't have spaces but their description does quite frequently. Meaning the check on spaces catches some potential errors in the API call. Removing this restriction would likely cause additional errors that might be hard for a user to spot initially.Then the question is should we allow newlines in App names? If not might be worth adding an additional validator to catch that and use it for app names, aliases, and group names.