File: lf.bash

package info (click to toggle)
lf 34%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,296 kB
  • sloc: sh: 126; makefile: 23; csh: 4
file content (34 lines) | stat: -rw-r--r-- 733 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Autocompletion for bash shell.
#
# You may put this file to a directory used by bash-completion:
#
#     mkdir -p ~/.local/share/bash-completion/completions
#     ln -s "/path/to/lf.bash" ~/.local/share/bash-completion/completions
#

_lf () {
    local -a opts=(
        -command
        -config
        -cpuprofile
        -doc
        -last-dir-path
        -log
        -memprofile
        -print-last-dir
        -print-selection
        -remote
        -selection-path
        -server
        -single
        -version
        -help
    )
    if [[ $2 == -* ]]; then
        COMPREPLY=( $(compgen -W "${opts[*]}" -- "$2") )
    else
        COMPREPLY=( $(compgen -f -d -- "$2") )
    fi
}

complete -o filenames -F _lf lf lfcd