File: nvtake.bash_completion

package info (click to toggle)
nvchecker 2.19-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 804 kB
  • sloc: python: 5,192; makefile: 30; sh: 27
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