Debian Codegraph @

bash-completion/lsclocks

raw
1 _lsclocks_module()
2 {
3 local cur prev OPTS
4 COMPREPLY=()
5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
7
8 case $prev in
9 '-J'|'--json')
10 return 0
11 ;;
12 '-n'|'--noheadings')
13 return 0
14 ;;
15 '-o'|'--output')
16 return 0
17 ;;
18 '--output-all')
19 return 0
20 ;;
21 '-r'|'--raw')
22 return 0
23 ;;
24 '-t'|'--time')
25 clocks="$(command "$1" --noheadings --raw --output NAME)"
26 COMPREPLY=( $(compgen -W "$clocks" -- "$cur") )
27 return 0
28 ;;
29 '-d'|'--dynamic-clock')
30 clocks="$(echo /dev/ptp*)"
31 COMPREPLY=( $(compgen -o filenames -W "$clocks" -- "$cur") )
32 return 0
33 ;;
34 '-x'|'--rtc')
35 clocks="$(echo /dev/rtc*)"
36 COMPREPLY=( $(compgen -o filenames -W "$clocks" -- "$cur") )
37 return 0
38 ;;
39 '-c'|'--cpu-clock')
40 _pids
41 return 0
42 ;;
43 '-h'|'--help'|'-V'|'--version')
44 return 0
45 ;;
46 esac
47 case $cur in
48 -*)
49 OPTS="--json
50 --noheadings
51 --output
52 --output-all
53 --raw
54 --time
55 --dynamic-clock
56 --no-discover-dynamic
57 --no-discover-rtc
58 --rtc
59 --cpu-clock
60 --help
61 --version"
62 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
63 return 0
64 ;;
65 *)
66 return 0
67 ;;
68 esac
69 return 0
70 }
71 complete -F _lsclocks_module lsclocks