mirror of
https://github.com/Gozargah/Marzban.git
synced 2026-05-17 00:25:53 +03:00
fix: marzban-cli completion app's --shell option
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import pydoc
|
||||
import typer
|
||||
from datetime import datetime
|
||||
from typing import Any, Iterable, Optional, TypeVar, Union
|
||||
from typing import Any, Dict, Iterable, Optional, TypeVar, Union
|
||||
|
||||
from rich.table import Table
|
||||
import typer
|
||||
from rich.console import Console
|
||||
from rich.table import Table
|
||||
|
||||
from app.db import crud
|
||||
from app.db.models import User
|
||||
@@ -14,7 +14,7 @@ T = TypeVar("T")
|
||||
rich_console = Console()
|
||||
PASSWORD_ENVIRON_NAME = "MARZBAN_ADMIN_PASSWORD"
|
||||
|
||||
FLAGS: dict[str, tuple] = {
|
||||
FLAGS: Dict[str, tuple] = {
|
||||
"username": ("--username", "-u"),
|
||||
"limit": ("--limit", "-l"),
|
||||
"offset": ("--offset", "-o"),
|
||||
|
||||
@@ -33,18 +33,18 @@ def get_default_shell() -> Shells:
|
||||
|
||||
|
||||
@app_completion.command(help="Show completion for the specified shell, to copy or customize it.")
|
||||
def show(ctx: typer.Context, shell: Shells = typer.Argument(None,
|
||||
help="The shell to install completion for.",
|
||||
case_sensitive=False)) -> None:
|
||||
def show(ctx: typer.Context, shell: Shells = typer.Option(None,
|
||||
help="The shell to install completion for.",
|
||||
case_sensitive=False)) -> None:
|
||||
if shell is None:
|
||||
shell = get_default_shell()
|
||||
typer.completion.show_callback(ctx, None, shell)
|
||||
|
||||
|
||||
@app_completion.command(help="Install completion for the specified shell.")
|
||||
def install(ctx: typer.Context, shell: Shells = typer.Argument(None,
|
||||
help="The shell to install completion for.",
|
||||
case_sensitive=False)) -> None:
|
||||
def install(ctx: typer.Context, shell: Shells = typer.Option(None,
|
||||
help="The shell to install completion for.",
|
||||
case_sensitive=False)) -> None:
|
||||
if shell is None:
|
||||
shell = get_default_shell()
|
||||
typer.completion.install_callback(ctx, None, shell)
|
||||
|
||||
Reference in New Issue
Block a user