commandlineparser / commandlineparser/commandline

Multiple long arguments

Open
#885 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.8k
Forks
478
PR merge metrics
No merged PRs in 30d

Description

Oftentimes it is useful to offer multiple long arguments for an option. A common case is a lengthy long argument for which you want to have a shorter version but the 1-char is not possible (e.g. because it's already assigned to other option).

For example, I have an option `DisableResourceWrites` with a long arg `--disableResourceWrites`, for which I would like it to shorten to `--drw` (`-d`, `-r` and `-w` are already taken).

I would like to use it like:
```cs
[Option(new [] { "disableResourceWrite", "drw" }, Required = false, HelpText = "Download resources even if they are already downloaded.")]
```

The help would show up like:

```
--disableResourceWrite, --drw Download resources even if they are already downloaded.
```

The unparsing would just choose the first long arg when short names are not preferred.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how option declarations are represented, rendered in help, and handled during unparsing. Add support for multiple long names so both names appear in help, the first is used when short names are not preferred, and existing single-name options continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.