Help verbose show hidden options (#5979)

* show hidden flags when showing verbose help
* flutter -v show verbose help
This commit is contained in:
Dan Rubel
2016-09-22 05:58:45 -04:00
committed by GitHub
parent 8e4ca4bd34
commit 3f68e187f3
6 changed files with 16 additions and 15 deletions

View File

@@ -47,8 +47,9 @@ import 'src/runner/flutter_command_runner.dart';
///
/// This function is intended to be used from the `flutter` command line tool.
Future<Null> main(List<String> args) async {
bool help = args.contains('-h') || args.contains('--help');
bool verbose = args.contains('-v') || args.contains('--verbose');
bool help = args.contains('-h') || args.contains('--help') ||
(args.isNotEmpty && args.first == 'help') || (args.length == 1 && verbose);
bool verboseHelp = help && verbose;
if (verboseHelp) {
@@ -58,8 +59,8 @@ Future<Null> main(List<String> args) async {
}
FlutterCommandRunner runner = new FlutterCommandRunner(verboseHelp: verboseHelp)
..addCommand(new AnalyzeCommand())
..addCommand(new BuildCommand())
..addCommand(new AnalyzeCommand(verboseHelp: verboseHelp))
..addCommand(new BuildCommand(verboseHelp: verboseHelp))
..addCommand(new ChannelCommand())
..addCommand(new ConfigCommand())
..addCommand(new CreateCommand())
@@ -74,7 +75,7 @@ Future<Null> main(List<String> args) async {
..addCommand(new PackagesCommand())
..addCommand(new PrecacheCommand())
..addCommand(new RefreshCommand())
..addCommand(new RunCommand())
..addCommand(new RunCommand(verboseHelp: verboseHelp))
..addCommand(new RunMojoCommand(hidden: !verboseHelp))
..addCommand(new ScreenshotCommand())
..addCommand(new SetupCommand(hidden: !verboseHelp))