aboutsummaryrefslogtreecommitdiffhomepage
path: root/make_vcs_completions.fish
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2007-03-25 05:37:14 +1000
committerGravatar axel <axel@liljencrantz.se>2007-03-25 05:37:14 +1000
commit94a483d46ba99143eb3ae4b4d6b200cf50a3f7f6 (patch)
treef54f1d0f5e6b2c5c850cf3203532b1ea8035fcd9 /make_vcs_completions.fish
parente750f1a3c2a76a1bf5093195ebb40e05e069281b (diff)
Minor tweak to vcs completion generation code. Most significantly, some svn command descriptions which where previously truncated are now complete.
darcs-hash:20070324193714-ac50b-61b10db649ef82ba8d8d658ef10cc05c2253d5f0.gz
Diffstat (limited to 'make_vcs_completions.fish')
-rwxr-xr-xmake_vcs_completions.fish9
1 files changed, 7 insertions, 2 deletions
diff --git a/make_vcs_completions.fish b/make_vcs_completions.fish
index 8c576d0a..486d7def 100755
--- a/make_vcs_completions.fish
+++ b/make_vcs_completions.fish
@@ -9,8 +9,12 @@ function cap
echo $res
end
+#
+# Escapes the single quote (') character and removes trailing whitespace from $argv
+#
+
function esc
- echo $argv | sed -e "s/'/\\\'/g"
+ echo $argv | sed -e "s/'/\\\'/g" | sed -e 's/ *$//'
end
@@ -142,7 +146,8 @@ function write_completions
end
for i in (list_subcommand)
- set desc (cmd help $i|head -n 1|sed -e 's/[^:]*: *\(.*[^.]\)\(\|\\.\)$/\1/')
+
+ set desc (cmd help $i|head -n 3| sed -e 's/usage:.*//'| tr \n \ | sed -e 's/[^:]*: *\(.*[^.]\)\(\|\\.\)$/\1/')
set desc (esc $desc)
set cmd_str $cmd_str "-a $i --description '$desc'"
end