Skip to content

Commit

Permalink
Add zsh completion
Browse files Browse the repository at this point in the history
Signed-off-by: Adrien Gallouët <[email protected]>
  • Loading branch information
angt committed Jan 15, 2021
1 parent 72e3b41 commit 19d58f5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,36 @@ Typically if you want to change the default `/usr/local` prefix:

### Tab completion

Tab completion works with `bash` and `yash` (`zsh` is also supported if you enable `bashcompinit`).
Tab completion works with `bash`, `zsh` and `yash`.
Unfortunately, it doesn't work out of the box, you have to setup it manually.
Luckily, it's super easy!

Download the file corresponding to your shell:
- [argz.bash](https://github.com/angt/argz/blob/dev/comp/argz.bash)
- [argz.yash](https://github.com/angt/argz/blob/dev/comp/argz.yash)

Then you can add these lines in your `.bashrc` (or `.zshrc`):
- [argz.bash](https://raw.githubusercontent.com/angt/argz/master/comp/argz.bash)
- [argz.yash](https://raw.githubusercontent.com/angt/argz/master/comp/argz.yash)
- [argz.zsh](https://raw.githubusercontent.com/angt/argz/master/comp/argz.zsh)

Then, for `bash`, you can add these lines in your `.bashrc`:

. YOUR_PATH_TO/argz.bash

. argz.bash
complete -F _argz secret

Or in your `.yashrc`:
For `yash`, in your `.yashrc`:

. argz.yash
. YOUR_PATH_TO/argz.yash

function completion/secret {
command -f completion//reexecute argz
}

And finally, for `zsh`, in your `.zshrc`:

. YOUR_PATH_TO/argz.zsh

compdef _argz secret

Completion for secrets is only available in a trusted shell. See below.

## Commands
Expand Down
2 changes: 1 addition & 1 deletion argz
Submodule argz updated 1 files
+13 −0 comp/argz.zsh
2 changes: 1 addition & 1 deletion libhydrogen
Submodule libhydrogen updated 1 files
+1 −1 LICENSE

0 comments on commit 19d58f5

Please sign in to comment.