dotnet / command-line-api

Command line parsing, invocation, and rendering of terminal output.
https://github.com/dotnet/command-line-api/wiki
MIT License
3.35k stars 375 forks source link

[Design] Is CLI syntax case sensitive? #2394

Open KathleenDollard opened 2 months ago

KathleenDollard commented 2 months ago

Should command lines be treated as case sensitive?

Case sensitive CLIs have different behavior for -x and -X, for example.

Arguments for case sensitivity

Many common utilities, including git use case sensitivity.

Is this in the Posix standard? Need link here if so.

There are more possibilities for identifiers if case is recognized

Arguments for *in-sensitivity

The PowerShell and Windows command prompt are case -insensitive.

Questions

Can't people just use ToLower if they want case-insensitivity?

No. This would change the case of arguments, as well as CLI syntax

KalleOlaviNiemitalo commented 2 months ago

Many common utilities, including git use case sensitivity.

Is this in the Posix standard? Need link here if so.

I'm not sure it outright says options are case sensitive; but it specifies the ls utility with distinct -A and -a options, and Utility Syntax Guidelines specifically reserve upper-case -W for vendor options.

Keboo commented 2 months ago

There was a lot of discussion around this when we first started. There are a lot of conflicting things in the wild. We landed on case sensitive, as it is easier to loosen those requirements in the future vs trying to tighten them. As mentioned above, many of the examples we found where there were casing differences were often short (single letter) options. We did not find many longer named identifiers that had different behavior based only on casing.

PonchoPowers commented 1 month ago

Just make it an option in CliConfiguration as then developers can choose whether it should be or not.