diff options
| author | Ville Skyttä <ville.skytta@iki.fi> | 2011-12-10 18:27:21 +0200 |
|---|---|---|
| committer | Ville Skyttä <ville.skytta@iki.fi> | 2011-12-10 18:27:21 +0200 |
| commit | f09ced610d6f9c9ea694d2eade7bdcf75e535afc (patch) | |
| tree | 6bb4ef1e0db05ce055afa078d473af36ae8bf539 /completions | |
| parent | 17c9722733a3e50f7b5113ca99fba9424b078274 (diff) | |
| download | bash-completion-f09ced610d6f9c9ea694d2eade7bdcf75e535afc.tar.gz | |
lzip: New completion.
Diffstat (limited to 'completions')
| -rw-r--r-- | completions/Makefile.am | 1 | ||||
| -rw-r--r-- | completions/lzip | 44 |
2 files changed, 45 insertions, 0 deletions
diff --git a/completions/Makefile.am b/completions/Makefile.am index 5b2e68ff..4570c217 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -170,6 +170,7 @@ bashcomp_DATA = a2x \ lrzip \ lsof \ lvm \ + lzip \ lzma \ lzop \ macof \ diff --git a/completions/lzip b/completions/lzip new file mode 100644 index 00000000..9df55382 --- /dev/null +++ b/completions/lzip @@ -0,0 +1,44 @@ +# lzip(1) completion -*- shell-script -*- + +_lzip() +{ + local cur prev words cword split + _init_completion -s || return + + local decompress=false + + case $prev in + -h|--help|-V|--version|-b|--member-size|-m|--match-length|\ + -s|--dictionary-size|-S|--volume-size) + return + ;; + -d|--decompress) + decompress=true + ;; + -o|--output) + _filedir + return + ;; + esac + + $split && return + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) {-1..-9}' \ + -- "$cur" ) ) + return + fi + + if $decompress; then + _filedir lz + return + fi + + local IFS=$'\n' + compopt -o filenames + COMPREPLY=( $( compgen -f -X "*.lz" -- "$cur" ) \ + $( compgen -d -- "$cur" ) ) +} && +complete -F _lzip lzip + +# ex: ts=4 sw=4 et filetype=sh |
