sdk icon indicating copy to clipboard operation
sdk copied to clipboard

`dart fix --help` doesn't help

Open bernaferrari opened this issue 2 years ago • 3 comments

I was following flutter's guide (https://github.com/flutter/flutter/wiki/Data-driven-Fixes#test-folder) and couldn't find --compare-to-golden in Dart fix help. I couldn't also find if there is a way to trigger "compare to golden" in a single file, because there is no documentation of anything.

image

bernaferrari avatar Sep 15 '22 16:09 bernaferrari

Not sure if this helps much, but adding -v prints:

$ dart fix -h -v
...
Usage: dart [vm-options] fix [arguments]
-h, --help                      Print this usage information.
-n, --dry-run                   Preview the proposed changes but make no changes.
    --apply                     Apply the proposed changes.
    --code=<code1,code2,...>    Apply fixes for one (or more) diagnostic codes.
    --compare-to-golden         Compare the result of applying fixes to a golden file for testing.

asashour avatar Sep 17 '22 04:09 asashour

I guess it could at least say -v option exists? But being so small, '-v' could replace '-h' maybe?

bernaferrari avatar Sep 17 '22 04:09 bernaferrari

-v is a global option

$ dart
...
Global options:
-h, --help                 Print this usage information.
-v, --verbose              Show additional command output.
    --version              Print the Dart SDK version.
    --enable-analytics     Enable analytics.
    --disable-analytics    Disable analytics.

asashour avatar Sep 17 '22 05:09 asashour

Yeah it's a feature that there are hidden options that --help will not show. Not sure why this one was chosen to be hidden. CC @bwilkerson

srawlins avatar Jan 10 '23 22:01 srawlins

Not sure why this one was chosen to be hidden.

Because it's only there for Flutter developers, not for the general user population.

bwilkerson avatar Jan 10 '23 22:01 bwilkerson

I'll close this then. I think it's good to hide such options, and not risk confusing users, or exposing something not supported for public use.

srawlins avatar Jan 11 '23 16:01 srawlins