-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_techcompressor.bash
More file actions
45 lines (38 loc) · 1.13 KB
/
_techcompressor.bash
File metadata and controls
45 lines (38 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
# Bash completion for techcompressor/techcmp
_techcompressor() {
local cur prev opts commands
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
# Main options
opts="--gui --benchmark --version --help"
# Commands
commands="create extract list compress decompress verify"
# Algorithm options
algorithms="LZW HUFFMAN DEFLATE"
case "${prev}" in
--algo)
COMPREPLY=( $(compgen -W "${algorithms}" -- ${cur}) )
return 0
;;
techcompressor|techcmp)
COMPREPLY=( $(compgen -W "${opts} ${commands}" -- ${cur}) )
return 0
;;
create|c)
COMPREPLY=( $(compgen -d -- ${cur}) )
return 0
;;
extract|x|list|l|compress|decompress|verify)
COMPREPLY=( $(compgen -f -- ${cur}) )
return 0
;;
*)
;;
esac
COMPREPLY=( $(compgen -W "${opts} ${commands}" -- ${cur}) )
return 0
}
complete -F _techcompressor techcompressor
complete -F _techcompressor techcmp