Skip to content

Commit f76f9ad

Browse files
authored
Support -? and /? help aliases (flutter-tizen#740)
1 parent 0361042 commit f76f9ad

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

lib/executable.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ Future<void> main(List<String> args) async {
7373
final bool verbose = args.contains('-v') || args.contains('--verbose') || veryVerbose;
7474
final bool prefixedErrors = args.contains('--prefixed-errors');
7575

76+
// Support universal help idioms.
77+
final int powershellHelpIndex = args.indexOf('-?');
78+
if (powershellHelpIndex != -1) {
79+
args[powershellHelpIndex] = '-h';
80+
}
81+
final int slashQuestionHelpIndex = args.indexOf('/?');
82+
if (slashQuestionHelpIndex != -1) {
83+
args[slashQuestionHelpIndex] = '-h';
84+
}
85+
7686
final bool doctor = (args.isNotEmpty && args.first == 'doctor') ||
7787
(args.length == 2 && verbose && args.last == 'doctor');
7888
final bool help = args.contains('-h') ||

0 commit comments

Comments
 (0)