mirror of
https://github.com/CZ-NIC/pz.git
synced 2022-02-13 01:03:07 +03:00
bash completion
This commit is contained in:
@@ -4,5 +4,6 @@ python:
|
||||
- 3.6
|
||||
- 3.7
|
||||
- 3.8
|
||||
- 3.9
|
||||
script:
|
||||
- python3 tests.py
|
||||
@@ -46,6 +46,7 @@ wikipedia.com
|
||||
+ [Command clauses](#command-clauses)
|
||||
+ [Input / output](#input--output)
|
||||
+ [Regular expressions shortcuts](#regular-expressions-shortcuts)
|
||||
+ [Bash completion](#bash-completion)
|
||||
|
||||
# Installation
|
||||
Install with a single command from [PyPi](https://pypi.org/project/pz/).
|
||||
@@ -689,3 +690,8 @@ As seen, `a` was incremented 3× times and `b` on twice because we had to proces
|
||||
helloworld
|
||||
anotherwords
|
||||
```
|
||||
|
||||
### Bash completion
|
||||
1. Run: `apt-get install bash-completion jq`
|
||||
2. Copy: [extra/pz-autocompletion.bash](./extra/pz-autocompletion.bash) to `/etc/bash_completion.d/`
|
||||
3. Restart terminal
|
||||
17
extra/pz-autocompletion.bash
Normal file
17
extra/pz-autocompletion.bash
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
# bash completion for pz
|
||||
_pz()
|
||||
{
|
||||
local cur
|
||||
local cmd
|
||||
|
||||
cur=${COMP_WORDS[$COMP_CWORD]}
|
||||
cmd=( ${COMP_WORDS[@]} )
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W "-h --help -v --verbose -q --quiet -S --setup -E --end -F --filter -f --format -w --whole -n -1 -0 --empty -g --generate --stderr --overflow-safe --search --match --findall --sub" -- $cur ) )
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
complete -F _pz -o default pz
|
||||
Reference in New Issue
Block a user