commandlineparser / commandlineparser/commandline

Multiple long arguments

Đang mở
#885 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C#
Star
4.8k
Fork
478
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.