8000 Merge branch 'devel' of https://github.com/arangodb/arangodb into devel · ezhangle/arangodb@c27d634 · GitHub
[go: up one dir, main page]

Skip to content

Commit c27d634

Browse files
committed
Merge branch 'devel' of https://github.com/arangodb/arangodb into devel
2 parents b331c22 + 4fe8fe1 commit c27d634

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

config/build_completions_fish.sh

Lines changed: 36 8000 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
if [[ "$1" == "" ]]; then
4+
echo "usage $0 outfile"
5+
exit 1
6+
fi
7+
out="$1"
8+
9+
echo "" > $out
10+
11+
for progname in arangob arangosh arangoimp arangodump arangorestore arangod
12+
do
13+
# find the executable
14+
# check if the executable exists
15+
if [[ -f "bin/$progname" ]]; then
16+
executable="bin/$progname"
17+
18+
# setup the help command string
19+
command="--help"
20+
if [ "x$progname" == "xarangod" ]; then
21+
command="--help-all"
22+
fi
23+
24+
# set up the list of completions for the executable
25+
# completions="`\"$executable\" $command | grep -o \"^\\ \\+--[a-z-]\\+\\(\\.[a-z0-9-]\\+\\)\\?\" | sed -e \"s/^/complete --command $progname -a /g\"`"
26+
echo "# completions for $progname" >> "$out"
27+
28+
completions="`\"$executable\" $command`"
29+
(echo "$completions" | grep "^ " | awk '/^ --/{if (x)print x;x="";}{x=(!x)?$0:x" "$0;}END{print x;}' | sed -e "s/ \+/ /g" | sed -e "s/(default:.*)//g" | sed -e "s/(current:.*)//g" | sed -e "s/<[a-zA-Z0-9]\+>//g" | tr -d "'" | sed -e "s/^ \+--\([a-zA-Z0-9.\-]\+\) \+\(.\+\)$/complete --command $progname -l '\\1' -d '\\2'/g" | sed -e "s/ \+'$/'/g") >> "$out"
30+
31+
echo "" >> "$out"
32+
fi
33+
done
34+
35+
echo "completions stored in file $out"
36+
echo "now copy this file to /etc/bash_completion.d/arangodb"

0 commit comments

Comments
 (0)
0