Skip to content

Commit a8d9e1d

Browse files
fixup! remote/client: sphinx autoprogram workarounds
AutoProgramArgumentParser generic choice
1 parent 011f80f commit a8d9e1d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

labgrid/remote/client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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

17541759
def 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)",

0 commit comments

Comments
 (0)