fork/fish-shell

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

Johannes AltmanningerMerge pull request #116984a12d5771

master
1.5 KiB30 linesraw
1function __fish_ninja
2    set -l saved_args $argv
3    set -l dir .
4    if argparse -u C/dir= -- (commandline -xpc)
5        command ninja -C$_flag_C $saved_args
6    end
7end
8
9function __fish_print_ninja_tools
10    __fish_ninja -t list | string match -v '*:' | string replace -r '\s+(\w+).*' '$1'
11end
12
13function __fish_print_ninja_targets
14    __fish_ninja -t targets 2>/dev/null | string replace -r ':.*' ''
15    __fish_ninja -t targets all 2>/dev/null | string replace -r ':.*' '' | string match -e -r '\.(?:o|so|a)$'
16end
17complete -c ninja -f -a '(__fish_print_ninja_targets)' -d target
18complete -x -c ninja -s t -x -a "(__fish_print_ninja_tools)" -d subtool
19complete -x -c ninja -s C -x -a "(__fish_complete_directories (commandline -ct))" -d "change to specified directory"
20complete -c ninja -s f -k -x -a "(__fish_complete_suffix .ninja)" -d "specify build file [default=build.ninja]"
21complete -f -c ninja -s n -d "dry run"
22complete -f -c ninja -s v -d "show all command lines while building"
23complete -f -c ninja -s j -d "number of jobs to run in parallel [default derived from CPUs]"
24complete -f -c ninja -s l -d "do not start if load average > N"
25complete -f -c ninja -s k -d "keep going until N jobs fail [default=1]"
26complete -f -c ninja -s h -d "show help"
27complete -f -c ninja -s d -d "enable debugging, specify debug mode"
28complete -f -c ninja -s w -d "adjust warnings, specify flags"
29complete -f -c ninja -s v -l verbose -d "show all command lines while building"
30complete -f -c ninja -l version -d "print ninja version"