Skip to content

Commit

Permalink
🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Dec 16, 2022
1 parent 830db81 commit 148e1b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions typer/_completion_click7.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ def do_powershell_complete(cli: click.Command, prog_name: str) -> bool:
incomplete = os.getenv("_TYPER_COMPLETE_WORD_TO_COMPLETE", "")
cursor = os.getenv("_TYPER_CURSOR_POSITION")
if cursor:
completion_args = completion_args[:int(cursor)]
completion_args = completion_args[: int(cursor)]
cwords = click.parser.split_arg_string(completion_args)
args = cwords[1:-1] if incomplete else cwords[1:]
args = cwords[1:-1] if incomplete else cwords[1:]
for item, help in click._bashcomplete.get_choices(cli, prog_name, args, incomplete):
click.echo(f"{item}:::{help or ' '}")

Expand Down
4 changes: 2 additions & 2 deletions typer/_completion_click8.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ def get_completion_args(self) -> Tuple[List[str], str]:
incomplete = os.getenv("_TYPER_COMPLETE_WORD_TO_COMPLETE", "")
cursor = os.getenv("_TYPER_CURSOR_POSITION")
if cursor:
completion_args = completion_args[:int(cursor)]
completion_args = completion_args[: int(cursor)]
cwords = click.parser.split_arg_string(completion_args)
args = cwords[1:-1] if incomplete else cwords[1:]
args = cwords[1:-1] if incomplete else cwords[1:]
return args, incomplete

def format_completion(self, item: click.shell_completion.CompletionItem) -> str:
Expand Down

0 comments on commit 148e1b2

Please sign in to comment.