File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
packages/flutter_tools/lib/src/runner Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -1884,29 +1884,20 @@ Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and
18841884 /// If no flag named [name] was added to the [ArgParser] , an [ArgumentError]
18851885 /// will be thrown.
18861886 bool boolArg (String name, {bool global = false }) {
1887- if (global) {
1888- return globalResults! [name] as bool ;
1889- }
1890- return argResults! [name] as bool ;
1887+ return (global ? globalResults : argResults)! .flag (name);
18911888 }
18921889
18931890 /// Gets the parsed command-line option named [name] as a `String` .
18941891 ///
18951892 /// If no option named [name] was added to the [ArgParser] , an [ArgumentError]
18961893 /// will be thrown.
18971894 String ? stringArg (String name, {bool global = false }) {
1898- if (global) {
1899- return globalResults! [name] as String ? ;
1900- }
1901- return argResults! [name] as String ? ;
1895+ return (global ? globalResults : argResults)! .option (name);
19021896 }
19031897
19041898 /// Gets the parsed command-line option named [name] as `List<String>` .
19051899 List <String > stringsArg (String name, {bool global = false }) {
1906- if (global) {
1907- return globalResults! [name] as List <String >;
1908- }
1909- return argResults! [name] as List <String >;
1900+ return (global ? globalResults : argResults)! .multiOption (name);
19101901 }
19111902}
19121903
You can’t perform that action at this time.
0 commit comments