diff options
author | B. Stack <bgstack15@gmail.com> | 2024-08-19 12:30:40 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2024-08-19 12:30:40 -0400 |
commit | 8f27989ba7524851b53140258390bb896674c9c4 (patch) | |
tree | a5adf03f058a6f47b0b7d5dfb8170b356ed40811 /src/etc/bash_completion.d/updatezone | |
parent | fix date in rpm changelog (diff) | |
download | ddtools-master.tar.gz ddtools-master.tar.bz2 ddtools-master.zip |
Diffstat (limited to 'src/etc/bash_completion.d/updatezone')
-rw-r--r-- | src/etc/bash_completion.d/updatezone | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/etc/bash_completion.d/updatezone b/src/etc/bash_completion.d/updatezone new file mode 100644 index 0000000..f55d1ce --- /dev/null +++ b/src/etc/bash_completion.d/updatezone @@ -0,0 +1,13 @@ +_updatezone_autocomplete() { + #devtty=/dev/pts/2 + local cur prev words cword; + _init_completion || return + local _tmpfile1="$( mktemp )" + grep -iE "UZ_ZONE_NAME=" /etc/ddtools/*.conf 2>/dev/null | sed -r -e 's/^UZ_.*=//;' >> "${_tmpfile1}" + #echo "----- ${cur} --- prev: ${prev} -- words: ${words} -- cword: ${cword} --" > "${devtty}" + grep -viE "${cur}" "${_tmpfile1}" + COMPREPLY=($( compgen -W "$( grep -viE "${prev}" "${_tmpfile1}" )" -- "$cur" )) + command rm -f "${_tmpfile1}" 1>/dev/null 2>&1 + return 0 +} +complete -F _updatezone_autocomplete updatezone |