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
1884
1884
/// If no flag named [name] was added to the [ArgParser] , an [ArgumentError]
1885
1885
/// will be thrown.
1886
1886
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);
1891
1888
}
1892
1889
1893
1890
/// Gets the parsed command-line option named [name] as a `String` .
1894
1891
///
1895
1892
/// If no option named [name] was added to the [ArgParser] , an [ArgumentError]
1896
1893
/// will be thrown.
1897
1894
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);
1902
1896
}
1903
1897
1904
1898
/// Gets the parsed command-line option named [name] as `List<String>` .
1905
1899
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);
1910
1901
}
1911
1902
}
1912
1903
You can’t perform that action at this time.
0 commit comments