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 #30

Open
DartBot opened this issue Jun 5, 2015 · 4 comments
Open

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

DartBot opened this issue Jun 5, 2015 · 4 comments
Assignees
Labels
type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="96" height="96"hspace="10"> Issue by munificent
Originally opened as dart-lang/sdk#19806


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 "/".
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent


Marked this as blocking dart-lang/sdk#7489.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/103167?v=3" align="left" width="48" height="48"hspace="10"> Comment by srawlins


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.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent


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.

@nex3
Copy link
Member

nex3 commented Jun 6, 2015

Uri.base can be used now to determine the operating system without importing dart:io.

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

No branches or pull requests

3 participants