mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 02:27:28 +08:00
Add completions for ninja build system
This commit is contained in:
parent
d2739f10e1
commit
61388cff02
10
share/completions/ninja.fish
Normal file
10
share/completions/ninja.fish
Normal file
|
@ -0,0 +1,10 @@
|
|||
complete -c ninja -f -a '(__fish_print_ninja_targets)' -d Target
|
||||
complete -x -c ninja -s t -x -a "(__fish_print_ninja_tools)" -d Tools
|
||||
complete -x -c ninja -s C -x -a "(__fish_complete_directories (commandline -ct))" -d "Change to DIR"
|
||||
complete -c ninja -s f -x -d "specify build file"
|
||||
complete -f -c ninja -s n -d "dry run"
|
||||
complete -f -c ninja -s v -d "show all command lines while building"
|
||||
complete -f -c ninja -s j -d "number of jobs"
|
||||
complete -f -c ninja -s l -d "do not start if load > N"
|
||||
complete -f -c ninja -s k -d "keep until N jobs fail"
|
||||
complete -f -c ninja -s h -d "help"
|
5
share/functions/__fish_print_ninja_targets.fish
Normal file
5
share/functions/__fish_print_ninja_targets.fish
Normal file
|
@ -0,0 +1,5 @@
|
|||
function __fish_print_ninja_targets
|
||||
if [ -f build.ninja ]
|
||||
ninja -t targets 2> /dev/null | string replace -r ':.*' ''
|
||||
end
|
||||
end
|
6
share/functions/__fish_print_ninja_tools.fish
Normal file
6
share/functions/__fish_print_ninja_tools.fish
Normal file
|
@ -0,0 +1,6 @@
|
|||
function __fish_print_ninja_tools
|
||||
echo list
|
||||
if [ -f build.ninja ]
|
||||
ninja -t list | string match -v '*:' | string replace -r '\s+(\w+).*' '$1'
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user