dotnet / dotnet/command-line-api

Option with non-eager optional argument, like --backup[=CONTROL]

Open
#2,072 3 comments 0 reactions 0 assignees View on GitHub
Area-Parser and Binder bug
Dominant language
C#
Stars
3.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

In GNU `getopt_long`, if an option has an optional argument, then it has to be in the same element of `char *argv[]`, connected with an equals sign. Thus, `numbered` is parsed as the argument of the option in `cp --backup=numbered source directory/` but as a separate argument (and treated as a file name) in `cp --backup numbered source directory/`. AFAICT, System.CommandLine cannot be configured to behave this way.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.