aboutsummaryrefslogtreecommitdiffhomepage
path: root/make_vcs_completions.fish
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2007-06-05 20:51:11 +1000
committerGravatar axel <axel@liljencrantz.se>2007-06-05 20:51:11 +1000
commit2caaa7526d8cd3226c9b9095840f99257f8a2394 (patch)
tree439dc0d34988d78e0b495ca3bf927f5372b8510e /make_vcs_completions.fish
parent778aa1c3042e6477a4b36dbde470c121798a331a (diff)
Make sure completion descriptions generated by make_vcs_completions.fish are properly escaped. Thanks to Claes Næstén for the bug report.
darcs-hash:20070605105111-ac50b-e2cbb17047be6c6b0ddf5847507986f50c97be4c.gz
Diffstat (limited to 'make_vcs_completions.fish')
-rwxr-xr-xmake_vcs_completions.fish7
1 files changed, 4 insertions, 3 deletions
diff --git a/make_vcs_completions.fish b/make_vcs_completions.fish
index 486d7def..25c69414 100755
--- a/make_vcs_completions.fish
+++ b/make_vcs_completions.fish
@@ -1,7 +1,8 @@
#!/usr/bin/env fish
-
#
-# This file produces command specific completions for either hg or darcs
+# This file produces command specific completions for hg, darcs and a
+# few other vcs systems. It uses the fact that all these systems have a
+# somewhat uniform command line help mechanism.
#
function cap
@@ -14,7 +15,7 @@ end
#
function esc
- echo $argv | sed -e "s/'/\\\'/g" | sed -e 's/ *$//'
+ echo $argv | sed -e "s/\(['\\\]\)/\\\\\1/g" | sed -e 's/ *$//' | sed -e 's/ .*//'
end