diff --git a/Docs/OptionalArgumentsConfig.md b/Docs/OptionalArgumentsConfig.md index a7d6d46..c1ff729 100644 --- a/Docs/OptionalArgumentsConfig.md +++ b/Docs/OptionalArgumentsConfig.md @@ -15,6 +15,7 @@ Optional arguments can be configured differently. Now you will find out exactly * [Default Value](#default-value) * [Value Restrictions](#value-restrictions) * [Required Options](#required-options) + * [Hidden Options And Aliases](#hidden-options-and-aliases) * [Context Capture](#context-capture) * [After Handling Action](#after-handling-action) @@ -150,6 +151,25 @@ var option = new ValueOption("angle", "a", isRequired: true); ``` +### Hidden Options And Aliases +Sometimes you need to hide an option from being used when printing command-line help. For example, to gradually refuse a deprecated argument name without breaking backwards compatibility. You can make the option hidden as follows: + +```cs +var option = new ValueOption("angle", "a", + description: "angle by which you want to rotate the image", + isHidden: true); +``` + +Another way to maintain backward compatibility is to use aliases. They will not be displayed when printing text, but can be used as an option identifier, just like the short and long names. You can specify option aliases as follows: + +```cs +var option = new ValueOption("angle", "a", + description: "angle by which you want to rotate the image", + aliases: ["rotation-angle", "rotation", "A"]); +``` + +Please note that aliases must be unique like short and long names. + ### Context Capture For multiple value options you can specify the number of arguments to be captured as their value. diff --git a/README.md b/README.md index b9d8c25..d0972b3 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,6 @@ You can find instructions for connecting **NetArgumentParser** to your project [ **NetArgumentParser** is currently under development. There are some features that need to be added to the project: - Add support of subcommands. - Add support of reflection-based configuring option set using special attributes. -- Add support of hidden arguments and aliases. - Add support of import and export JSON configuration. - Add support of parent parsers. - Add NuGet package.