Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion LICENCE
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Alternatives

- `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
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand All @@ -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](<https://en.wikipedia.org/wiki/Shebang_(Unix)>) `#!/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
Expand All @@ -102,7 +102,7 @@ application. Use `-u, --error-unimportable` to noisily complain.
- executes the underlying script *every* time `<TAB>` 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
Expand Down
2 changes: 1 addition & 1 deletion docs/use.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down