Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Design] Powderhouse parsing subtleties #2393

Open
KathleenDollard opened this issue Apr 23, 2024 · 2 comments
Open

[Design] Powderhouse parsing subtleties #2393

KathleenDollard opened this issue Apr 23, 2024 · 2 comments
Labels
Design Powderhouse Work to isolate parser and features

Comments

@KathleenDollard
Copy link
Contributor

KathleenDollard commented Apr 23, 2024

As the Powderhouse core parser moves into the BCL, the parsing choices will made will become common across .NET applications. Supplying this consistency is a prime goal of providing a core parser layer. There is tension between the simplest behavior for end users, flexibility for CLI authors, and absolute correctness.

This a tracking issue to collect specific issues and reference the behavior of other systems to help nail down recommendations that we will take through the .NET API review process. Further comments on the challenges appear below the issues:

[ ] Is CLI syntax treated as case sensitive? #2394
[ ] Does Posix bundling loses to explicit options? #2395
[ ] Can arguments can appear after options? #2396
[ ] Are multiple arguments per option token are supported for collections? #2397
[ ] Are multiple option tokens are supported for single value options (last one wins)? #2398
[ ] Do we retain current -- behavior (.NET CLI may be nonstandard)? #2399
[ ] Is any syntax (like punctuation) is allowed for options? #2400
[ ] Is any syntax (like punctuation) is allowed for commands? #2401

Where Posix standards express an opinion, we will use that opinion unless there is a good reason not to.

System.CommandLine established standards, primarily based on correctness and flexibility. Providing flexibility to CLI authors results in inconsistency for end users. An example is AllowMultipleArgumentsPerToken. Changes from System.CommandLine behavior need to balance against breaking existing CLI scripts.

Some common Posix behavior is unexpected by end users, especially users with a strong Windows background.

This a tracking issue to collect specific issues and reference the behavior of other systems to help nail down recommendations that we will take through the .NET API review process.

Please limit discussion on specific issues to those issues.

@KathleenDollard KathleenDollard added Design Powderhouse Work to isolate parser and features labels Apr 23, 2024
@KalleOlaviNiemitalo
Copy link

For example, git expects options to follow arguments, while many other CLIs do not.

No, options in Git must generally precede arguments such as pathspecs:

$ git log Source/ --all
fatal: option '--all' must come before non-option arguments

The exception is that branch names and revision ranges can come before and between options (git log --no-merges master --date=iso).

@KathleenDollard KathleenDollard changed the title Powderhouse parsing subtleties [Design] Powderhouse parsing subtleties Apr 23, 2024
@KathleenDollard
Copy link
Contributor Author

Thanks, updated and cleaned up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Powderhouse Work to isolate parser and features
Projects
None yet
Development

No branches or pull requests

2 participants