From f3883bdc6d48022a046166fc800f0a432b2932b8 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Mon, 17 Nov 2025 14:17:05 +0100 Subject: [PATCH 1/3] docs: minor typo and grammar fixes --- CONTRIBUTING.md | 6 +++--- README.rst | 2 +- docs/index.md | 6 +++--- docs/use.md | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1aefb4f..0d85299 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,10 +30,10 @@ Most of the magic lives in [`shtab/__init__.py`](./shtab/__init__.py). Given that the number of completions a program may need would likely be less than a million, the focus is on readability rather than premature speed -optimisations. The generated code itself, on the other had, should be fast. +optimisations. The generated code itself, on the other hand, should be fast. -Helper functions such as `replace_format` allows use of curly braces `{}` in -string snippets without clashing between Python's `str.format` and shell +Helper functions such as `replace_format` allow the use of curly braces `{}` +in string snippets without clashes between Python's `str.format` and shell parameter expansion. The generated shell code itself is also meant to be readable. diff --git a/README.rst b/README.rst index e80e075..98a7db8 100644 --- a/README.rst +++ b/README.rst @@ -89,7 +89,7 @@ Alternatives - `click `_ - - different framework completely replacing the builtin ``argparse`` + - different framework completely replacing the built-in ``argparse`` - solves multiple problems (rather than POSIX-style "do one thing well") Contributions diff --git a/docs/index.md b/docs/index.md index 6d71c0e..002d6a4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -62,7 +62,7 @@ follow the OS-specific instructions below. fi ``` -=== "MacOS" +=== "macOS" First run `brew install bash-completion`, then add the following to `~/.bash_profile`: @@ -82,7 +82,7 @@ Not working? - if using [`options.entry_points.console_scripts=MY_PROG=...`](https://setuptools.pypa.io/en/latest/userguide/entry_point.html), then ensure the main parser's `prog` matches `argparse.ArgumentParser(prog="MY_PROG")` or override it using `shtab MY_PROG.get_main_parser --prog=MY_PROG`. - if executing a script file `./MY_PROG.py` (with a [shebang]() `#!/usr/bin/env python`) directly, then use `argparse.ArgumentParser(prog="MY_PROG.py")` or override it using `shtab MY_PROG.get_main_parser --prog=MY_PROG.py`. - Make sure that all arguments have `help` messages (`parser.add_argument('positional', help="documented; i.e. not hidden")`). -- [Ask a general question on StackOverflow](https://stackoverflow.com/questions/tagged/shtab). +- [Ask a general question on Stack Overflow](https://stackoverflow.com/questions/tagged/shtab). - [Report bugs and open feature requests on GitHub][GH-issue]. "Eager" installation (completions are re-generated upon login/terminal start) is @@ -102,7 +102,7 @@ application. Use `-u, --error-unimportable` to noisily complain. - executes the underlying script *every* time `` is pressed (slow and has side-effects) - only provides `zsh` completion - [click](https://pypi.org/project/click) - - different framework completely replacing the builtin `argparse` + - different framework completely replacing the built-in `argparse` - solves multiple problems (rather than POSIX-style "do one thing well") ## Contributions diff --git a/docs/use.md b/docs/use.md index 5fdee70..a941109 100644 --- a/docs/use.md +++ b/docs/use.md @@ -170,7 +170,7 @@ Add direct support to scripts for a little more configurability: def get_main_parser(): parser = argparse.ArgumentParser(prog="pathcomplete") shtab.add_argument_to(parser, ["-s", "--print-completion"]) # magic! - # file & directory tab complete + # file and directory tab completion parser.add_argument("file", nargs="?").complete = shtab.FILE parser.add_argument("--dir", default=".").complete = shtab.DIRECTORY return parser From 88c05a18b95db30800f00240323d686f6763ec39 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Mon, 17 Nov 2025 14:21:42 +0100 Subject: [PATCH 2/3] docs: fix pre-commit installation command At least on zsh, it does not work without quoting. --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0d85299..4a2ba5e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ When contributing pull requests, it's a good idea to run basic checks locally: ```bash # install development dependencies -shtab (main)$ pip install pre-commit -e .[dev] +shtab (main)$ pip install pre-commit -e ".[dev]" shtab (main)$ pre-commit install # install pre-commit checks shtab (main)$ pytest # run all tests ``` From 503b3d46f0089250f5a6271d72f009c963205cee Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Mon, 17 Nov 2025 14:24:12 +0100 Subject: [PATCH 3/3] LICENCE: update year to 2025 --- LICENCE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENCE b/LICENCE index f20defc..3ef16d8 100644 --- a/LICENCE +++ b/LICENCE @@ -1,4 +1,4 @@ -Copyright 2020-2023 Casper da Costa-Luis +Copyright 2020-2025 Casper da Costa-Luis Licensed under the Apache Licence, Version 2.0 (the "Licence"); you may not use this project except in compliance with the Licence.