Repository navigation
[WIP] Subcommand support, grouped switches and many other improvements and refactorings for Argu v.3 - #54
Merged
Conversation
|
I could not find an issue to comment on this topic. |
Member
|
Will the usage strings on subcommands be in attributes? |
Member
|
🎆 🎂 |
This was referenced Jun 30, 2016
Closed
Closed
This file contains hidden or 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
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.
This PR introduces significant changes to the library in what will be Argu version 3. Here are some of the main changes:
Subcommand support
Introduces support for nested union arguments. For instance:
This can be used to provide contextual arguments based on the initial argument. For instance:
Calling
git push --helpinstead ofgit --helpwill result in contextual help text being displayed. To give you an example, this template now generates the following help text:whereas using the contextual help parameter results in
Grouped Switches
Adds support for grouping of switches, i.e. arguments that take zero parameters and are of the form
-for-X. For instance the templatenow recognizes arguments of the form
-fdxas being equivalent to-f -d -x.Optional and Variadic parameters
Adds support for parameters that take optional, or list parameters. For instance
can be used to parse command line arguments of the form
--optional,--list 1 2 3,--optional 2and--list. Note that optional/variadic parameters can only occur in arguments of arity 1. Also note that the parsing strategy of Argu has been slightly modified in order to accommodate this feature.EqualsAssignment support for arity 2
Adds support for the EqualsAssignment attribute in parameters of arity 2. For example
which can be used to parse expressions of the form
--environment-variable key=valueMisc Improvements
UniqueAttributefor declaring that parameter should be specified at most once. Dual to theMandatoryAttribute.HelpFlagsAttribute,HelpDescriptionAttributeandDisableHelpFlagsAttributecan be used to control the look of the--helpparameters.ArguException.PrintLabelsAttributewhich takes advantage of F# 3.1 DU labels is now enabled by default.ParseResult.UnrecognizedCliParamsproperty which collects all CLI parameters not recognized by the parser. This also addresses issue Gather unrecognized arguments #55.