File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -88,10 +88,6 @@ def get_device_manager() -> DeviceManager:
88
88
return device_manager
89
89
90
90
91
- app = typer .Typer ()
92
-
93
-
94
- @app .command (hidden = True )
95
91
def list_devices () -> NoReturn :
96
92
device_manager = get_device_manager ()
97
93
console = Console ()
@@ -105,6 +101,9 @@ def list_devices() -> NoReturn:
105
101
raise typer .Exit ()
106
102
107
103
104
+ app = typer .Typer ()
105
+
106
+
108
107
@app .callback (invoke_without_command = True )
109
108
def default (
110
109
ctx : typer .Context ,
@@ -123,7 +122,8 @@ def default(
123
122
"--device" ,
124
123
help = (
125
124
"Select a particular device by filtering for a given substring "
126
- "in the device's manufacturer, product or serial number"
125
+ "in the device's manufacturer, product or serial number. "
126
+ 'Use "--device list" to list all available devices.'
127
127
),
128
128
rich_help_panel = "Device Configuration" ,
129
129
),
@@ -378,6 +378,9 @@ def default(
378
378
# Neither --verbose flag nor the environment variable is set.
379
379
set_not_verbose ()
380
380
381
+ if device_pattern == ["list" ]:
382
+ list_devices ()
383
+
381
384
# Raise informative errors with old dymoprint arguments
382
385
if preview :
383
386
raise typer .BadParameter (
You can’t perform that action at this time.
0 commit comments