Skip to content

Commit d8894a6

Browse files
committed
add bash completion
Signed-off-by: Zen <[email protected]>
1 parent ba59771 commit d8894a6

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

completion/ugrd.bash

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
_ugrd_autocomplete() {
2+
local cur prev args
3+
cur="${COMP_WORDS[COMP_CWORD]}"
4+
prev="${COMP_WORDS[COMP_CWORD-1]}"
5+
args="--build-logging --no-build-logging -c --config --kernel-version --kver --clean --no-clean --validate --no-validate --hostonly --no-hostonly\
6+
--lspci --no-lspci --lsmod --no-lsmod --firmware --no-firmware --autodetect-root --no-autodetect-root --autodetect-root-luks\
7+
--no-autodetect-root-luks --print-config out_file"
8+
9+
COMPREPLY=()
10+
11+
case "${prev}" in
12+
--config|-c)
13+
COMPREPLY=( "$(compgen -f -- "${cur}")" )
14+
return 0
15+
;;
16+
--kernel-version|--kver)
17+
COMPREPLY=( "$(compgen -W "$(ls /lib/modules)" -- "${cur}")" )
18+
return 0
19+
;;
20+
*)
21+
COMPREPLY=( "$(compgen -W "${args}" -- "${cur}")" )
22+
return 0
23+
;;
24+
esac
25+
26+
}
27+
28+
complete -F _ugrd_autocomplete ugrd

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "ugrd"
7-
version = "1.2.4"
7+
version = "1.3.0"
88
authors = [
99
{ name="Desultory", email="[email protected]" },
1010
]

0 commit comments

Comments
 (0)