Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit d02013a

Browse files
customizable descriptions for all drivers
this allows override of the default strings to show up in the jmp shell CLI. exporter: driver_x: type: x description: "this command does x"
1 parent 7084e68 commit d02013a

File tree

16 files changed

+167
-27
lines changed
  • packages
    • jumpstarter-driver-composite/jumpstarter_driver_composite
    • jumpstarter-driver-flashers/jumpstarter_driver_flashers
    • jumpstarter-driver-gpiod/jumpstarter_driver_gpiod
    • jumpstarter-driver-network/jumpstarter_driver_network
    • jumpstarter-driver-opendal/jumpstarter_driver_opendal
    • jumpstarter-driver-power/jumpstarter_driver_power
    • jumpstarter-driver-probe-rs/jumpstarter_driver_probe_rs
    • jumpstarter-driver-pyserial/jumpstarter_driver_pyserial
    • jumpstarter-driver-ridesx/jumpstarter_driver_ridesx
    • jumpstarter-driver-shell/jumpstarter_driver_shell
    • jumpstarter-driver-snmp/jumpstarter_driver_snmp
    • jumpstarter/jumpstarter

16 files changed

+167
-27
lines changed

packages/jumpstarter-driver-composite/jumpstarter_driver_composite/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def close(self):
3434
v.close()
3535

3636
def cli(self):
37-
@click.group
37+
@click.group(help=self.description or "Generic composite device")
3838
@click.option(
3939
"--log-level",
4040
"log_level",
@@ -44,7 +44,6 @@ def cli(self):
4444
callback=_opt_log_level_callback,
4545
)
4646
def base():
47-
"""Generic composite device"""
4847
pass
4948

5049
for k, v in self.children.items():

packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,9 +750,8 @@ def _validate_bearer_token(self, token: str | None) -> str | None:
750750
return token
751751

752752
def cli(self):
753-
@click.group
753+
@click.group(help=self.description or "Software-defined flasher interface")
754754
def base():
755-
"""Software-defined flasher interface"""
756755
pass
757756

758757
@base.command()

packages/jumpstarter-driver-gpiod/jumpstarter_driver_gpiod/client.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ def read(self):
3434
return PinState(int(self.call("read_pin")))
3535

3636
def cli(self):
37-
@click.group()
37+
@click.group(help=self.description or "GPIO power control commands.")
3838
def gpio():
39-
"""GPIO power control commands."""
4039
pass
4140

4241
for cmd in super().cli().commands.values():
@@ -79,9 +78,8 @@ def read(self):
7978
return PinState(int(self.call("read_pin")))
8079

8180
def cli(self):
82-
@click.group()
81+
@click.group(help=self.description or "GPIO input commands.")
8382
def gpio():
84-
"""GPIO input commands."""
8583
pass
8684

8785
@gpio.command()

packages/jumpstarter-driver-network/jumpstarter_driver_network/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ def address(self):
2020
return self.call("address")
2121

2222
def cli(self):
23-
@click.group
23+
@click.group(help=self.description or "Generic Network Connection")
2424
def base():
25-
"""Generic Network Connection"""
2625
pass
2726

2827
@base.command()

packages/jumpstarter-driver-opendal/jumpstarter_driver_opendal/client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,9 @@ def cli(self): # noqa: C901
413413
arg_dst = click.argument("dst", type=click.Path())
414414
opt_expire_second = click.option("--expire-second", type=int, required=True)
415415

416-
@click.group
416+
@click.group(help=self.description or "Opendal Storage")
417417
def base():
418-
"""Opendal Storage"""
418+
pass
419419

420420
@base.command
421421
@arg_path
@@ -548,9 +548,8 @@ def dump(
548548
...
549549

550550
def cli(self):
551-
@click.group
551+
@click.group(help=self.description or "Generic flasher interface")
552552
def base():
553-
"""Generic flasher interface"""
554553
pass
555554

556555
@base.command()

packages/jumpstarter-driver-power/jumpstarter_driver_power/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ def read(self) -> Generator[PowerReading, None, None]:
3535
yield PowerReading.model_validate(v, strict=True)
3636

3737
def cli(self):
38-
@click.group
38+
@click.group(help=self.description or "Generic power")
3939
def base():
40-
"""Generic power"""
4140
pass
4241

4342
@base.command()

packages/jumpstarter-driver-probe-rs/jumpstarter_driver_probe_rs/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ def read(self, width: int, address: int, words: int) -> list[int]:
6060
return [int(data, 16) for data in data_strs]
6161

6262
def cli(self): # noqa: C901
63-
@click.group
63+
@click.group(help=self.description or "probe-rs client")
6464
def base():
65-
"""probe-rs client"""
6665
pass
6766

6867
@base.command()

packages/jumpstarter-driver-pyserial/jumpstarter_driver_pyserial/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ def pexpect(self):
3636
yield adapter
3737

3838
def cli(self):
39-
@click.group
39+
@click.group(help=self.description or "Serial port client")
4040
def base():
41-
"""Serial port client"""
4241
pass
4342

4443
@base.command()

packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def flash(
102102
def cli(self):
103103
generic_cli = FlasherClient.cli(self)
104104

105-
@click.group()
105+
@click.group(help=self.description or "RideSX storage operations")
106106
def storage():
107107
pass
108108

packages/jumpstarter-driver-shell/jumpstarter_driver_shell/client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ def execute(*args, **kwargs):
4141

4242
def cli(self):
4343
"""Create CLI interface for dynamically configured shell methods"""
44-
@click.group
44+
@click.group(help=self.description or "Shell command executor")
4545
def base():
46-
"""Shell command executor"""
4746
pass
4847

4948
# Get available methods from the driver
@@ -80,12 +79,12 @@ def method_command(args, env):
8079
except Exception:
8180
description = f"Execute the {method_name} shell method"
8281

83-
# Decorate and register the command
84-
method_command.__doc__ = description
82+
# Decorate and register the command with help text
8583
method_command = click.argument('args', nargs=-1, type=click.UNPROCESSED)(method_command)
8684
method_command = click.option('--env', '-e', multiple=True,
8785
help='Environment variables in KEY=VALUE format')(method_command)
8886
method_command = group.command(
8987
name=method_name,
88+
help=description,
9089
context_settings={"ignore_unknown_options": True, "allow_interspersed_args": False},
9190
)(method_command)

0 commit comments

Comments
 (0)