@@ -12,6 +12,10 @@ class SomeCommand extends Command<int> {
1212 abbr: 'd' ,
1313 help: 'A discrete option with "allowed" values (mandatory)' ,
1414 allowed: ['foo' , 'bar' , 'faa' ],
15+ aliases: [
16+ 'allowed' ,
17+ 'defined-values' ,
18+ ],
1519 allowedHelp: {
1620 'foo' : 'foo help' ,
1721 'bar' : 'bar help' ,
@@ -20,18 +24,29 @@ class SomeCommand extends Command<int> {
2024 mandatory: true ,
2125 )
2226 ..addOption (
23- 'continuous' ,
24- abbr: 'c' ,
27+ 'hidden' ,
28+ hide: true ,
29+ help: 'A hidden option' ,
30+ )
31+ ..addOption (
32+ 'continuous' , // intentionally, this one does not have an abbr
2533 help: 'A continuous option: any value is allowed' ,
2634 )
2735 ..addMultiOption (
2836 'multi-d' ,
2937 abbr: 'm' ,
30- allowed: ['fii' , 'bar' , 'fee' ],
38+ allowed: [
39+ 'fii' ,
40+ 'bar' ,
41+ 'fee' ,
42+ 'i have space' , // arg parser wont accept space on "allowed" values,
43+ // therefore this should never appear on completions
44+ ],
3145 allowedHelp: {
3246 'fii' : 'fii help' ,
3347 'bar' : 'bar help' ,
3448 'fee' : 'fee help' ,
49+ 'i have space' : 'an allowed option with space on it' ,
3550 },
3651 help: 'An discrete option that can be passed multiple times ' ,
3752 )
@@ -66,6 +81,12 @@ class SomeCommand extends Command<int> {
6681 @override
6782 String get name => 'some_command' ;
6883
84+ @override
85+ List <String > get aliases => [
86+ 'disguised:some_commmand' ,
87+ 'melon' ,
88+ ];
89+
6990 @override
7091 Future <int > run () async {
7192 for (final option in argResults! .options) {
0 commit comments