commandlineparser / commandlineparser/commandline

Multiple long arguments

未关闭
#885 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C#
星标
4.8k
派生
478
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先跟踪选项声明的表示方式、在帮助中呈现的方式,以及在 unparsing 期间的处理方式。添加对多个长名称的支持,使两个名称都出现在帮助中;当不优先使用短名称时使用第一个名称,并确保现有的单名称选项继续正常工作。

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp
领域
cli
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。