Skip to content

Commit

Permalink
Remove patch for Click Bash completion
Browse files Browse the repository at this point in the history
Introduced in #11. See #10.
  • Loading branch information
superatomic committed Aug 18, 2023
1 parent 1f464bf commit f24d018
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
5 changes: 1 addition & 4 deletions src/tldr_man/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,12 @@
from click_help_colors import HelpColorsCommand

from tldr_man import pages
from tldr_man.shell_completion import page_shell_complete, language_shell_complete, patch_bash_completion
from tldr_man.shell_completion import page_shell_complete, language_shell_complete
from tldr_man.languages import get_locales
from tldr_man.platforms import get_page_sections, TLDR_PLATFORMS
from tldr_man.util import unique, mkstemp_path


patch_bash_completion() # See issue #10


def standalone_subcommand(func):
"""Function decorator to reduce boilerplate code at the start and end of all subcommand callback functions."""
@wraps(func)
Expand Down
9 changes: 0 additions & 9 deletions src/tldr_man/shell_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,3 @@ def language_shell_complete(_ctx: Context, _param: Parameter, _incomplete: str)
if not CACHE_DIR.exists():
return []
return [CompletionItem(code) for code in all_language_codes()]


def patch_bash_completion():
"""
Patches click Bash shell completion generation to not raise an error on generating for Bash versions older than 4.4.
Fixes <https://github.com/superatomic/tldr-man/issues/10>, <https://github.com/pallets/click/issues/2574>.
"""
BashComplete._check_version = lambda _: None

0 comments on commit f24d018

Please sign in to comment.