File: lf.bash

package info (click to toggle)
lf 28-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 640 kB
  • sloc: sh: 129; makefile: 22; csh: 4
file content (32 lines) | stat: -rw-r--r-- 684 bytes parent folder | download
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
# 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
        -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