File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
discoveryapis_generator/bin Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,9 @@ ArgResults parseArguments(ArgParser parser, List<String> arguments) {
6464Never dieWithUsage ([String ? message]) {
6565 if (message != null ) {
6666 print (message);
67+ print ('' );
6768 }
69+
6870 print ('Usage:' );
6971 print ('The discovery generator has the following sub-commands:' );
7072 print ('' );
@@ -88,12 +90,15 @@ Never dieWithUsage([String? message]) {
8890void main (List <String > arguments) {
8991 final parser = globalArgParser ();
9092 final options = parseArguments (parser, arguments);
91- final commandOptions = options.command! ;
92- final subCommands = ['package' , 'files' ];
9393
9494 if (options['help' ] as bool ) {
9595 dieWithUsage ();
96- } else if (! subCommands.contains (commandOptions.name)) {
96+ }
97+
98+ final commandOptions = options.command;
99+ final subCommands = ['package' , 'files' ];
100+
101+ if (commandOptions == null || ! subCommands.contains (commandOptions.name)) {
97102 dieWithUsage ('Invalid command' );
98103 }
99104
You can’t perform that action at this time.
0 commit comments