remove StripSubcommandHelpFormatter, StripHelpFormatter now handles commands + command groups.

This commit is contained in:
onyx-and-iris 2026-03-01 01:04:54 +00:00
parent c642bbc1f2
commit b3cfc6bc4a
5 changed files with 8 additions and 24 deletions

View File

@ -5,11 +5,7 @@ description = "A command-line interface for Voicemeeter leveraging VBAN."
readme = "README.md"
license = { text = "LICENSE" }
requires-python = ">=3.13"
dependencies = [
"cyclopts>=4.6.0",
"loguru>=0.7.3",
"vban-cmd>=2.6.0",
]
dependencies = ["cyclopts>=4.6.0", "loguru>=0.7.3", "vban-cmd>=2.6.0"]
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python",
@ -28,4 +24,4 @@ vban-cli = "vban_cli.app:run"
package = true
[tool.uv.sources]
vban-cmd = { path = "../vban-cmd-python" }
vban-cmd = { path = "../vban-cmd-python", editable = true }

View File

@ -3,9 +3,9 @@ from typing import Annotated
from cyclopts import App, Argument, Parameter
from .context import Context
from .help import StripSubcommandHelpFormatter
from .help import StripHelpFormatter
app = App(name='comp', help_formatter=StripSubcommandHelpFormatter())
app = App(name='comp', help_formatter=StripHelpFormatter())
@app.meta.default

View File

@ -3,9 +3,9 @@ from typing import Annotated
from cyclopts import App, Argument, Parameter
from .context import Context
from .help import StripSubcommandHelpFormatter
from .help import StripHelpFormatter
app = App(name='denoiser', help_formatter=StripSubcommandHelpFormatter())
app = App(name='denoiser', help_formatter=StripHelpFormatter())
@app.meta.default

View File

@ -3,9 +3,9 @@ from typing import Annotated
from cyclopts import App, Argument, Parameter
from .context import Context
from .help import StripSubcommandHelpFormatter
from .help import StripHelpFormatter
app = App(name='gate', help_formatter=StripSubcommandHelpFormatter())
app = App(name='gate', help_formatter=StripHelpFormatter())
@app.meta.default

View File

@ -61,18 +61,6 @@ class StripHelpFormatter(BaseHelpFormatter):
console.print(f'[bold]Usage:[/bold] {modified_usage}')
class StripSubcommandHelpFormatter(BaseHelpFormatter):
"""Help formatter for strip subcommands that injects <index> after 'strip'."""
def render_usage(self, console: Console, options: ConsoleOptions, usage) -> None:
"""Render the usage line with index argument injected after 'strip'."""
if usage:
modified_usage = re.sub(
r'(\S+\s+strip)\s+(\w+)\s+(COMMAND)', r'\1 <index> \2 \3', str(usage)
)
console.print(f'[bold]Usage:[/bold] {modified_usage}')
class BusHelpFormatter(BaseHelpFormatter):
"""Help formatter for bus commands that injects <index> after 'bus'."""