From a361cde1df0edc4d02461bb01d0bb547aac92c3b Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 3 Dec 2019 17:29:06 +0900 Subject: [PATCH] Move __fish_complete_svn_diff into the completion script --- po/de.po | 5 ---- po/en.po | 4 --- po/fr.po | 4 --- po/nb.po | 4 --- po/nn.po | 4 --- po/pl.po | 4 --- po/pt_BR.po | 5 ---- po/sv.po | 4 --- po/zh_CN.po | 5 ---- share/completions/svn.fish | 30 +++++++++++++++++-- share/functions/__fish_complete_svn_diff.fish | 25 ---------------- 11 files changed, 27 insertions(+), 67 deletions(-) delete mode 100644 share/functions/__fish_complete_svn_diff.fish diff --git a/po/de.po b/po/de.po index 3aee82ef7..62d767293 100644 --- a/po/de.po +++ b/po/de.po @@ -67198,11 +67198,6 @@ msgstr "" msgid "Complete using files" msgstr "Saloppe Einhäng-Optionen tolerieren" -#: /tmp/fish/implicit/share/functions/__fish_complete_svn_diff.fish:1 -#, fuzzy -msgid "Complete \"svn diff\" arguments" -msgstr "Anzahl der Argumente zählen" - #: /tmp/fish/implicit/share/functions/__fish_complete_user_at_hosts.fish:1 #, fuzzy msgid "Print list host-names with user@" diff --git a/po/en.po b/po/en.po index f3beabd7e..2064783e0 100644 --- a/po/en.po +++ b/po/en.po @@ -66549,10 +66549,6 @@ msgstr "" msgid "Complete using files" msgstr "Complete using path" -#: /tmp/fish/implicit/share/functions/__fish_complete_svn_diff.fish:1 -msgid "Complete \"svn diff\" arguments" -msgstr "Complete “svn diff” arguments" - #: /tmp/fish/implicit/share/functions/__fish_complete_user_at_hosts.fish:1 #, fuzzy msgid "Print list host-names with user@" diff --git a/po/fr.po b/po/fr.po index 4a0d674ae..7396be22e 100644 --- a/po/fr.po +++ b/po/fr.po @@ -65525,10 +65525,6 @@ msgstr "" msgid "Complete using files" msgstr "Compléter en utilisant les fichiers" -#: /tmp/fish/implicit/share/functions/__fish_complete_svn_diff.fish:1 -msgid "Complete \"svn diff\" arguments" -msgstr "" - #: /tmp/fish/implicit/share/functions/__fish_complete_user_at_hosts.fish:1 #, fuzzy msgid "Print list host-names with user@" diff --git a/po/nb.po b/po/nb.po index b6b72c1b2..76885be55 100644 --- a/po/nb.po +++ b/po/nb.po @@ -61987,10 +61987,6 @@ msgstr "" msgid "Complete using files" msgstr "" -#: /tmp/fish/implicit/share/functions/__fish_complete_svn_diff.fish:1 -msgid "Complete \"svn diff\" arguments" -msgstr "" - #: /tmp/fish/implicit/share/functions/__fish_complete_user_at_hosts.fish:1 msgid "Print list host-names with user@" msgstr "" diff --git a/po/nn.po b/po/nn.po index ea4ac501c..6d0e889a1 100644 --- a/po/nn.po +++ b/po/nn.po @@ -61987,10 +61987,6 @@ msgstr "" msgid "Complete using files" msgstr "" -#: /tmp/fish/implicit/share/functions/__fish_complete_svn_diff.fish:1 -msgid "Complete \"svn diff\" arguments" -msgstr "" - #: /tmp/fish/implicit/share/functions/__fish_complete_user_at_hosts.fish:1 msgid "Print list host-names with user@" msgstr "" diff --git a/po/pl.po b/po/pl.po index 2a31f0d72..03dea99e1 100644 --- a/po/pl.po +++ b/po/pl.po @@ -62576,10 +62576,6 @@ msgstr "" msgid "Complete using files" msgstr "" -#: /tmp/fish/implicit/share/functions/__fish_complete_svn_diff.fish:1 -msgid "Complete \"svn diff\" arguments" -msgstr "" - #: /tmp/fish/implicit/share/functions/__fish_complete_user_at_hosts.fish:1 msgid "Print list host-names with user@" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 0f7848944..bbbbef369 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -67668,11 +67668,6 @@ msgstr "" msgid "Complete using files" msgstr "Tolerate sloppy mount options" -#: /tmp/fish/implicit/share/functions/__fish_complete_svn_diff.fish:1 -#, fuzzy -msgid "Complete \"svn diff\" arguments" -msgstr "Count the number of arguments" - #: /tmp/fish/implicit/share/functions/__fish_complete_user_at_hosts.fish:1 #, fuzzy msgid "Print list host-names with user@" diff --git a/po/sv.po b/po/sv.po index 91406d12a..d298c438e 100644 --- a/po/sv.po +++ b/po/sv.po @@ -61991,10 +61991,6 @@ msgstr "" msgid "Complete using files" msgstr "" -#: /tmp/fish/implicit/share/functions/__fish_complete_svn_diff.fish:1 -msgid "Complete \"svn diff\" arguments" -msgstr "" - #: /tmp/fish/implicit/share/functions/__fish_complete_user_at_hosts.fish:1 msgid "Print list host-names with user@" msgstr "" diff --git a/po/zh_CN.po b/po/zh_CN.po index cd4306433..e80c66d28 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -62536,11 +62536,6 @@ msgstr "" msgid "Complete using files" msgstr "" -#: /tmp/fish/implicit/share/functions/__fish_complete_svn_diff.fish:1 -#, fuzzy -msgid "Complete \"svn diff\" arguments" -msgstr "参数的个数的计数" - #: /tmp/fish/implicit/share/functions/__fish_complete_user_at_hosts.fish:1 msgid "Print list host-names with user@" msgstr "" diff --git a/share/completions/svn.fish b/share/completions/svn.fish index 7e02653d3..c23efbf89 100644 --- a/share/completions/svn.fish +++ b/share/completions/svn.fish @@ -1,3 +1,29 @@ +function __fish_complete_svn_diff --description 'Complete "svn diff" arguments' + set -l cmdl (commandline -cop) + #set -l cmdl svn diff --diff-cmd diff --extensions '-a -b' + set -l diff diff + set -l args + while set -q cmdl[1] + switch $cmdl[1] + case --diff-cmd + if set -q cmdl[2] + set diff $cmdl[2] + set -e cmd[2] + end + + case --extensions + if set -q cmdl[2] + set args $cmdl[2] + set -e cmdl[2] + end + end + set -e cmdl[1] + end + set -l token (commandline -cpt) + complete -C"$diff $args $token" + +end + function _svn_cmpl_ -d 'Make a completion for a subcommand' --no-scope-shadowing --argument-names subcommand set -e argv[1] complete -c svn -n "__fish_seen_subcommand_from $subcommand" $argv @@ -166,9 +192,7 @@ for cmd in $blame $diff $log $merge _svn_cmpl_ $cmd -l extensions -s x -d 'Ignore all whitespace' -xa '-w --ignore-all-space' _svn_cmpl_ $cmd -l extensions -s x -d 'Ignore eol style' -xa '-w --ignore-eol-style' _svn_cmpl_ $cmd -l extensions -s x -d 'Show C function name' -xa '-p --show-c-function' - - # Next completion doesn't work, since fish doesn't respect -x key - #_svn_cmpl_ $cmd -l extensions -n '__fish_seen_subcommand_from --diff-cmd' -xa '(__fish_complete_svn_diff)' + _svn_cmpl_ $cmd -l extensions -n '__fish_seen_subcommand_from --diff-cmd' -xa '(__fish_complete_svn_diff)' end for cmd in $cleanup $merge $switch $update diff --git a/share/functions/__fish_complete_svn_diff.fish b/share/functions/__fish_complete_svn_diff.fish deleted file mode 100644 index eb67fcc21..000000000 --- a/share/functions/__fish_complete_svn_diff.fish +++ /dev/null @@ -1,25 +0,0 @@ -function __fish_complete_svn_diff --description 'Complete "svn diff" arguments' - set -l cmdl (commandline -cop) - #set -l cmdl svn diff --diff-cmd diff --extensions '-a -b' - set -l diff diff - set -l args - while set -q cmdl[1] - switch $cmdl[1] - case --diff-cmd - if set -q cmdl[2] - set diff $cmdl[2] - set -e cmd[2] - end - - case --extensions - if set -q cmdl[2] - set args $cmdl[2] - set -e cmdl[2] - end - end - set -e cmdl[1] - end - set -l token (commandline -cpt) - complete -C"$diff $args $token" - -end