From 2de3f7c68674e386df9c96819356bc158b6ac604 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Fri, 15 Mar 2019 19:53:20 +0100 Subject: [PATCH] Move ninja functions into ninja completions Part of #5279 [ci skip] --- share/completions/ninja.fish | 12 ++++++++++++ share/functions/__fish_print_ninja_targets.fish | 5 ----- share/functions/__fish_print_ninja_tools.fish | 6 ------ 3 files changed, 12 insertions(+), 11 deletions(-) delete mode 100644 share/functions/__fish_print_ninja_targets.fish delete mode 100644 share/functions/__fish_print_ninja_tools.fish diff --git a/share/completions/ninja.fish b/share/completions/ninja.fish index 0dd0174bf..935d324bd 100644 --- a/share/completions/ninja.fish +++ b/share/completions/ninja.fish @@ -1,3 +1,15 @@ +function __fish_print_ninja_tools + echo list + if test -f build.ninja + ninja -t list | string match -v '*:' | string replace -r '\s+(\w+).*' '$1' + end +end + +function __fish_print_ninja_targets + if test -f build.ninja + ninja -t targets 2>/dev/null | string replace -r ':.*' '' + end +end 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" diff --git a/share/functions/__fish_print_ninja_targets.fish b/share/functions/__fish_print_ninja_targets.fish deleted file mode 100644 index 18d62fba6..000000000 --- a/share/functions/__fish_print_ninja_targets.fish +++ /dev/null @@ -1,5 +0,0 @@ -function __fish_print_ninja_targets - if [ -f build.ninja ] - ninja -t targets 2>/dev/null | string replace -r ':.*' '' - end -end diff --git a/share/functions/__fish_print_ninja_tools.fish b/share/functions/__fish_print_ninja_tools.fish deleted file mode 100644 index 385c91edc..000000000 --- a/share/functions/__fish_print_ninja_tools.fish +++ /dev/null @@ -1,6 +0,0 @@ -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