fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Fabian BoehmRestyle fishscript and python946ecf235

master
1.5 KiB27 linesraw
1# openocd is a utility for programming microcontrollers, especially popular with
2# developers targeting ARM devices. It has a number of pre-installed configuration
3# scripts to control its connection behavior which are in its installation directory
4# and may be specified at the command line via relative paths as if you were cd'd
5# into that directory.
6
7# Retrieve the likely compile-time PREFIX for openocd based off of where the binary
8# is located. e.g. if openocd is /usr/local/bin/openocd return /usr/local
9function __fish_openocd_prefix
10    string replace /bin/openocd "" (command -s openocd)
11end
12
13# The results of this function are as if __fish_complete_suffix were called
14# while cd'd into the openocd scripts directory
15function __fish_complete_openocd_path
16    __fish_complete_suffix --prefix=(__fish_openocd_prefix)/share/openocd/scripts "$argv[1]"
17end
18
19complete -c openocd -f # at no point does openocd take arbitrary arguments
20complete -c openocd -s h -l help -d "display help"
21complete -c openocd -s v -l version -d "display version info"
22complete -c openocd -s f -l file -k -xa '(__fish_complete_openocd_path .cfg)'
23complete -c openocd -s d -l debug -d "run under debug level 3"
24complete -c openocd -s d -l debug -d "run under debug level n" -xa '(seq 1 9)'
25complete -c openocd -s l -l log_output -d "redirect output to file" -r
26complete -c openocd -s c -l command -d "run command"
27complete -c openocd -s s -l search -d "search path for config files and scripts" -xa '(__fish_complete_directories)'