mirror of
https://github.com/onyx-and-iris/vban-cli.git
synced 2026-04-16 02:23:30 +00:00
remove StripSubcommandHelpFormatter, StripHelpFormatter now handles commands + command groups.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user