commandlineparser / commandlineparser/commandline
Support + (plus) sign for flags to UNSET a flag often used by Linux
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 478
- PR merge metrics
- No merged PRs in 30d
Description
>All of the single letter options that have a corresponding name can be used as an argument to the -o option. The set -o name is provided next to the single letter option in the description below. Specifying a dash “-” turns the option on, while using a plus “+” disables the option.
Meaning, assume you have the following option:
[Option('x', "XXXX", Required = false, Default = true)]
public bool X { get; set; }
And you would pass `+x`, then the result should be `False`:
app.exe +x
This seems like a better approach then a nullable bool:
[Option('x', "XXXX", Required = false, Default = true)]
public bool? X { get; set; }
As that requires to pass:
app.exe -x false
Contributor guide
No contributing guide indexed for this repository
Research direction
Search the command-line option parsing entry point for existing single-letter flag handling and tests covering option prefixes. Verify that an option declared with a true default becomes false when invoked as +x, while preserving the documented -x behavior; add coverage for the requested syntax.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100