command-line-api icon indicating copy to clipboard operation
command-line-api copied to clipboard

[Design] Is CLI syntax case sensitive?

Open KathleenDollard opened this issue 1 year ago • 3 comments

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

KathleenDollard avatar Apr 23 '24 11:04 KathleenDollard

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.

KalleOlaviNiemitalo avatar Apr 23 '24 12:04 KalleOlaviNiemitalo

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.

Keboo avatar Apr 23 '24 16:04 Keboo

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

PonchoPowers avatar Jun 07 '24 02:06 PonchoPowers