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

Support "/" options on Windows, and "/?" for help #19806

Closed
munificent opened this issue Jul 2, 2014 · 4 comments
Closed

Support "/" options on Windows, and "/?" for help #19806

munificent opened this issue Jul 2, 2014 · 4 comments
Assignees
Labels
area-pkg type-enhancement A request for a change that isn't a bug

Comments

@munificent
Copy link
Member

Right now, args follows Unix conventions (such as they are) for option syntax. Many Windows applications also do that, but Windows also has its own rough conventions. Some don't play nice with what args already supports, but I think we should allow:

  1. "/?" as an alias for "--help".
  2. Long and short options can start with "/" instead of "-" and "--". Combined short options are not supported, so "/foo" is always "--foo" and never "-f -o o".
  3. ":" as a parameter separator, as in "/output:somefile.txt". This will only be supported when the prefix is "/".
@munificent
Copy link
Member Author

Marked this as blocking #7489.

@srawlins
Copy link
Member

srawlins commented Oct 7, 2014

I think it would be crazy unexpected if on a non-Windows system, args parsed arguments starting with a / as an option. IE:

my_dart_script --foo=bar /baz

If my_dart_script happens to also have an option "--baz" defined, it should not read "/baz" as an option! I suggest using Platform.isWindows for this feature. This is still a little wonky, however, because then Window folks would still be able to supply options with -- and with /, so the above example is just as confusing, but only for Windows folks.

@munificent
Copy link
Member Author

Yeah, I don't think we should support any of this on non-Windows platforms. Platform.isWindows is probably the right approach, but note that that's a breaking change for args. Currently, it doesn't import anything except "dart:io" and it can be used outside of the standalone VM.

@DartBot
Copy link

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/args#30.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants