nvchecker/scripts/nvtake.bash_completion

17 lines
565 B
Plaintext
Raw Normal View History

2020-09-01 12:13:50 +00:00
# MIT licensed
# Copyright (c) 2020 Felix Yan <felixonmars@archlinux.org>, et al.
_nvtake() {
local cur _nvchecker_conf_mtime
_init_completion || return
_nvchecker_conf_mtime="$(stat -c %Y $HOME/.config/nvchecker/*)"
2020-09-01 12:13:50 +00:00
if [ -z "$_nvtake_completion_cache" -o "$_nvchecker_conf_mtime" != "$_nvchecker_conf_mtime_cached" ]; then
_nvtake_completion_cache="$(nvcmp -q)"
_nvchecker_conf_mtime_cached="$_nvchecker_conf_mtime"
2020-09-01 12:13:50 +00:00
fi
COMPREPLY=( $(compgen -W "$_nvtake_completion_cache" -- "$cur") )
} &&
complete -F _nvtake nvtake