Skip to content

Commit d5aae00

Browse files
committed
Updated __main__.precommand_callback
Removed inappropriate docstring.
1 parent 1588bcd commit d5aae00

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

src/busylight/__main__.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
except ImportError:
4747
pass
4848

49-
webcli = typer.Typer()
50-
5149

5250
@cli.callback(invoke_without_command=True, no_args_is_help=True)
5351
def precommand_callback(
@@ -86,25 +84,7 @@ def precommand_callback(
8684
help="Time out command in seconds.",
8785
),
8886
) -> None:
89-
"""Control USB connected presence lights.
90-
91-
:param ctx: Typer context for sharing state between commands
92-
:param debug: Enable debug logging output
93-
:param targets: Comma-separated list of light indices to target
94-
:param all_lights: Override target selection to use all lights
95-
:param dim: Brightness percentage from 0-100
96-
:param timeout: Maximum operation duration in seconds
97-
98-
This callback function processes global CLI options and sets up the
99-
application state before any subcommand runs. It handles:
100-
101-
- Parsing light target specifications
102-
- Configuring logging based on debug flag
103-
- Setting up the global options object
104-
- Special handling for the 'list' command with no targets
105-
106-
The function exits with help text if no subcommand is specified.
107-
"""
87+
"""Control USB connected presence lights."""
10888
(logger.enable if debug else logger.disable)("busylight")
10989

11090
options = ctx.ensure_object(GlobalOptions)
@@ -117,13 +97,10 @@ def precommand_callback(
11797
if ctx.invoked_subcommand == "list" and targets is None:
11898
all_lights = True
11999

120-
# Parse light targets - simple conversion for now
121100
if targets:
122-
# Convert comma-separated string to list of indices
123101
try:
124102
options.lights = [int(x.strip()) for x in targets.split(",")]
125103
except ValueError:
126-
# If parsing fails, use empty list (all lights)
127104
options.lights = []
128105

129106
logger.info(f"version {__version__}")

0 commit comments

Comments
 (0)