File: nvtake.bash_completion

package info (click to toggle)
python-nvchecker 2.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 736 kB
  • sloc: python: 4,801; makefile: 25
file content (16 lines) | stat: -rw-r--r-- 565 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 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/*)"
    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"
    fi

    COMPREPLY=( $(compgen -W "$_nvtake_completion_cache" -- "$cur") )
} &&
    complete -F _nvtake nvtake