File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1748,7 +1748,12 @@ def add_subparsers(self, **kwargs):
17481748 action = super ().add_subparsers (** kwargs )
17491749 return self ._ActionWrapper (action )
17501750
1751+ def add_argument (self , * args , ** kwargs ):
1752+ # do not show ranges
1753+ if isinstance (kwargs .get ("choices" ), range ):
1754+ del kwargs ["choices" ]
17511755
1756+ return super ().add_argument (* args , ** kwargs )
17521757
17531758
17541759def get_parser (auto_doc_mode = False ) -> "argparse.ArgumentParser | AutoProgramArgumentParser" :
@@ -2053,7 +2058,7 @@ def get_parser(auto_doc_mode=False) -> "argparse.ArgumentParser | AutoProgramArg
20532058 "-p" ,
20542059 "--partition" ,
20552060 type = int ,
2056- choices = ( None if auto_doc_mode else range (0 , 256 ) ),
2061+ choices = range (0 , 256 ),
20572062 metavar = "0-255" ,
20582063 default = 1 ,
20592064 help = "partition number to mount or 0 to mount whole disk (default: %(default)s)" ,
You can’t perform that action at this time.
0 commit comments