mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 10:01:46 +04:00
Add shell completions by shtab
pre-commit --print-completion bash | sudo tee /usr/share/bash-completion/completions/pre-commit pre-commit --print-completion zsh | sudo tee /usr/share/zsh/site-functions/_pre-commit pre-commit --print-completion tcsh | sudo tee /etc/profile.d/pre-commit.completion.csh
This commit is contained in:
parent
3fe38dff05
commit
9f6123d912
3 changed files with 45 additions and 3 deletions
16
pre_commit/_shtab.py
Normal file
16
pre_commit/_shtab.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from typing import Any
|
||||
|
||||
FILE = None
|
||||
DIRECTORY = DIR = None
|
||||
|
||||
|
||||
def add_argument_to(
|
||||
parser: ArgumentParser, *args: list[Any], **kwargs: dict[Any, Any],
|
||||
) -> ArgumentParser:
|
||||
from argparse import Action
|
||||
|
||||
Action.complete = None # type: ignore
|
||||
return parser
|
||||
Loading…
Add table
Add a link
Reference in a new issue