2019-10-25 13:47:43 +00:00
|
|
|
function __fish_ninja
|
|
|
|
set -l saved_args $argv
|
|
|
|
set -l dir .
|
2020-04-13 18:41:52 +00:00
|
|
|
if argparse -i C/dir= -- (commandline -opc)
|
2020-04-02 07:43:22 +00:00
|
|
|
# Using eval to expand ~ and variables specified on the commandline.
|
|
|
|
eval command ninja -C$_flag_C \$saved_args
|
|
|
|
end
|
2019-10-25 13:47:43 +00:00
|
|
|
end
|
|
|
|
|
2019-03-15 18:53:20 +00:00
|
|
|
function __fish_print_ninja_tools
|
2019-10-25 13:47:43 +00:00
|
|
|
__fish_ninja -t list | string match -v '*:' | string replace -r '\s+(\w+).*' '$1'
|
2019-03-15 18:53:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function __fish_print_ninja_targets
|
2019-10-25 13:47:43 +00:00
|
|
|
__fish_ninja -t targets 2>/dev/null | string replace -r ':.*' ''
|
2023-12-12 12:53:04 +00:00
|
|
|
__fish_ninja -t targets all 2>/dev/null | string replace -r ':.*' '' | string match -e -r '\.(?:o|so|a)$'
|
2019-03-15 18:53:20 +00:00
|
|
|
end
|
2017-10-09 08:21:04 +00:00
|
|
|
complete -c ninja -f -a '(__fish_print_ninja_targets)' -d target
|
|
|
|
complete -x -c ninja -s t -x -a "(__fish_print_ninja_tools)" -d subtool
|
|
|
|
complete -x -c ninja -s C -x -a "(__fish_complete_directories (commandline -ct))" -d "change to specified directory"
|
2020-12-13 07:27:21 +00:00
|
|
|
complete -c ninja -s f -k -x -a "(__fish_complete_suffix .ninja)" -d "specify build file [default=build.ninja]"
|
2016-09-27 22:17:24 +00:00
|
|
|
complete -f -c ninja -s n -d "dry run"
|
|
|
|
complete -f -c ninja -s v -d "show all command lines while building"
|
2017-10-09 08:21:04 +00:00
|
|
|
complete -f -c ninja -s j -d "number of jobs to run in parallel [default derived from CPUs]"
|
|
|
|
complete -f -c ninja -s l -d "do not start if load average > N"
|
|
|
|
complete -f -c ninja -s k -d "keep going until N jobs fail [default=1]"
|
|
|
|
complete -f -c ninja -s h -d "show help"
|
|
|
|
complete -f -c ninja -s d -d "enable debugging, specify debug mode"
|
|
|
|
complete -f -c ninja -s w -d "adjust warnings, specify flags"
|
|
|
|
complete -f -c ninja -l version -d "print ninja version"
|