@@ -417,6 +417,8 @@ def _build_options(self):
417417 self .parser .add_argument (* args , ** kwargs )
418418
419419 def get_buildtest_options (self ):
420+ """This method is used to return all main options for buildtest command line interface. This is useful for bash completion script
421+ where we need to return all options for buildtest command line interface for tab completion."""
420422 main_options = set ()
421423 for args , kwargs in self .buildtest_options :
422424 for name in args :
@@ -670,13 +672,13 @@ def history_menu(self):
670672 self .parent_parser ["terse" ],
671673 self .parent_parser ["no-header" ],
672674 ],
673- "args " : [],
675+ "arguments " : [],
674676 },
675677 {
676678 "name" : "query" ,
677679 "help" : "Query information for a particular build" ,
678680 "parents" : [self .parent_parser ["pager" ]],
679- "args " : [
681+ "arguments " : [
680682 (["id" ], {"type" : int , "help" : "Select a build ID" }),
681683 (
682684 ["-l" , "--log" ],
@@ -702,7 +704,7 @@ def history_menu(self):
702704 help = subparser_info ["help" ],
703705 parents = subparser_info ["parents" ],
704706 )
705- for args , kwargs in subparser_info ["args " ]:
707+ for args , kwargs in subparser_info ["arguments " ]:
706708 subparser .add_argument (* args , ** kwargs )
707709
708710 def build_menu (self ):
@@ -983,7 +985,7 @@ def buildspec_menu(self):
983985 self .parent_parser ["terse" ],
984986 self .parent_parser ["no-header" ],
985987 ],
986- "args " : [
988+ "arguments " : [
987989 (
988990 ["-b" , "--breakdown" ],
989991 {
@@ -998,7 +1000,7 @@ def buildspec_menu(self):
9981000 "help" : "Show content of buildspec file" ,
9991001 "parents" : [self .parent_parser ["theme" ]],
10001002 "aliases" : ["s" ],
1001- "args " : [
1003+ "arguments " : [
10021004 (
10031005 ["name" ],
10041006 {
@@ -1013,7 +1015,7 @@ def buildspec_menu(self):
10131015 "help" : "Show content of buildspec file for all failed tests" ,
10141016 "parents" : [self .parent_parser ["theme" ]],
10151017 "aliases" : ["sf" ],
1016- "args " : [
1018+ "arguments " : [
10171019 (
10181020 ["name" ],
10191021 {
@@ -1027,15 +1029,15 @@ def buildspec_menu(self):
10271029 "name" : "summary" ,
10281030 "help" : "Print summary of buildspec cache" ,
10291031 "parents" : [self .parent_parser ["theme" ], self .parent_parser ["pager" ]],
1030- "args " : [],
1032+ "arguments " : [],
10311033 "aliases" : ["sm" ],
10321034 },
10331035 {
10341036 "name" : "validate" ,
10351037 "help" : "Validate buildspecs with JSON Schema" ,
10361038 "parents" : [],
10371039 "aliases" : ["val" ],
1038- "args " : [
1040+ "arguments " : [
10391041 (
10401042 ["-b" , "--buildspec" ],
10411043 {
@@ -1082,7 +1084,7 @@ def buildspec_menu(self):
10821084 parents = cmd_info ["parents" ],
10831085 aliases = cmd_info .get ("aliases" , []),
10841086 )
1085- for arg_info in cmd_info .get ("args " , []):
1087+ for arg_info in cmd_info .get ("arguments " , []):
10861088 subcommand [name ].add_argument (* arg_info [0 ], ** arg_info [1 ])
10871089
10881090 # build menu for 'buildtest buildspec maintainers' command
@@ -1219,7 +1221,7 @@ def buildspec_find_menu(self, buildspec_find_parser):
12191221 "name" : "invalid" ,
12201222 "help" : "Show invalid buildspecs" ,
12211223 "parents" : [self .parent_parser ["row-count" ]],
1222- "args " : [
1224+ "arguments " : [
12231225 (
12241226 ["-e" , "--error" ],
12251227 {"action" : "store_true" , "help" : "Show error messages" },
@@ -1239,7 +1241,7 @@ def buildspec_find_menu(self, buildspec_find_parser):
12391241 parents = cmd_info ["parents" ],
12401242 aliases = cmd_info .get ("aliases" , []),
12411243 )
1242- for arg_info in cmd_info .get ("args " , []):
1244+ for arg_info in cmd_info .get ("arguments " , []):
12431245 subcommand [name ].add_argument (* arg_info [0 ], ** arg_info [1 ])
12441246
12451247 def config_menu (self ):
@@ -1638,7 +1640,7 @@ def inspect_menu(self):
16381640 "aliases" : ["b" ],
16391641 "help" : "Inspect a test based on buildspec" ,
16401642 "parents" : [self .parent_parser ["pager" ]],
1641- "args " : [
1643+ "arguments " : [
16421644 (
16431645 ["buildspec" ],
16441646 {"nargs" : "*" , "help" : "List of buildspecs to query" },
@@ -1656,13 +1658,13 @@ def inspect_menu(self):
16561658 "aliases" : ["n" ],
16571659 "help" : "Specify name of test" ,
16581660 "parents" : [self .parent_parser ["pager" ]],
1659- "args " : [(["name" ], {"nargs" : "*" , "help" : "Name of test" })],
1661+ "arguments " : [(["name" ], {"nargs" : "*" , "help" : "Name of test" })],
16601662 },
16611663 "query" : {
16621664 "aliases" : ["q" ],
16631665 "help" : "Query fields from record" ,
16641666 "parents" : [self .parent_parser ["pager" ], self .parent_parser ["theme" ]],
1665- "args " : [
1667+ "arguments " : [
16661668 (
16671669 ["-b" , "--buildscript" ],
16681670 {"action" : "store_true" , "help" : "Print build script" },
@@ -1701,7 +1703,7 @@ def inspect_menu(self):
17011703 self .parent_parser ["terse" ],
17021704 self .parent_parser ["no-header" ],
17031705 ],
1704- "args " : [
1706+ "arguments " : [
17051707 (
17061708 ["-b" , "--builder" ],
17071709 {"action" : "store_true" , "help" : "List test in builder format" },
@@ -1718,7 +1720,7 @@ def inspect_menu(self):
17181720 help = options ["help" ],
17191721 parents = options ["parents" ],
17201722 )
1721- for arg_info in options ["args " ]:
1723+ for arg_info in options ["arguments " ]:
17221724 parser .add_argument (* arg_info [0 ], ** arg_info [1 ])
17231725
17241726 return
0 commit comments