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

dart2native: reverse -o & -k in help #39154

Closed
kwalrath opened this issue Oct 29, 2019 · 3 comments
Closed

dart2native: reverse -o & -k in help #39154

kwalrath opened this issue Oct 29, 2019 · 3 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. vm-native

Comments

@kwalrath
Copy link
Contributor

The help text for dart2native is almost but not quite in alpha order (2.6.0-dev.8.1). Move the -o line after -k, and we'll be good.

$ dart2native --help
Usage: dart2native <main-dart-file> [<options>]

Generates an executable or an AOT snapshot from <main-dart-file>.

-D, --define=<key=value>       Set values of environment variables. To specify
                               multiple variables, use multiple options or use
                               commas to separate key-value pairs.
                               E.g.: dart2native -Da=1,b=2 main.dart

    --enable-asserts           Enable assert statements.
-h, --help                     Display this help message.
-o, --output=<path>            Set the output filename. <path> can be relative
                               or absolute.
                               E.g.: dart2native main.dart -o ../bin/my_app.exe

-k, --output-kind=<aot|exe>    
          [aot]                Generate an AOT snapshot.
          [exe] (default)      Generate a standalone executable.

-p, --packages=<path>          Get package locations from the specified file
                               instead of .packages. <path> can be relative or
                               absolute.
                               E.g.: dart2native --packages=/tmp/pkgs main.dart

-v, --verbose                  Show verbose output.
@ghost
Copy link

ghost commented Oct 29, 2019

This ordering is intentional since it is alpha ordered by the (full) flag name:

    ..addFlag('enable-asserts', ...
    ..addFlag('help', ...
    ..addOption('output', ...
    ..addOption('output-kind', ...
    ..addOption('packages', ...

The confusion I believe comes from some of the flags having an optional abbreviation ('o', 'k', ...), which doesn't follow the same order.
But since not all flags have an abbreviation that does not make a good sorting key.

I would suggest we leave the order as is.

@devoncarew devoncarew added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. vm-native labels Oct 29, 2019
@kwalrath
Copy link
Contributor Author

Unfortunately the abbreviations come first, so it's easy to think it's a mistake. (I actually missed the -k flag when I first wrote the docs, possibly because of this.)

One more thing... Some flags have blank lines above them in the help, and some don't. Can we make them all have a blank line separator?

@ghost
Copy link

ghost commented Oct 30, 2019

I personally prefer the current order, but I'll leave it up to you.

The blank lines, like some of the previous discussion about formatting choices and key=value pairs, is ultimately up to the args package.
In https://github.com/dart-lang/args/issues/48 it's stated that the forced newline after all multiline flags is WAI. It's been suggested to make it configurable, but I don't think it's been implemented yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. vm-native
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants