[irstlm] 82/146: Improved update_completion script.
Giulio Paci
giuliopaci-guest at moszumanska.debian.org
Tue May 17 07:37:11 UTC 2016
This is an automated email from the git hooks/post-receive script.
giuliopaci-guest pushed a commit to branch master
in repository irstlm.
commit d7266e95d8d0fb0e82275159ad93c7df6a35fdb6
Author: Giulio Paci <giuliopaci at gmail.com>
Date: Sat May 4 19:47:29 2013 +0200
Improved update_completion script.
---
debian/scripts/update_completion | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/debian/scripts/update_completion b/debian/scripts/update_completion
index 6bdbc91..d0bf535 100755
--- a/debian/scripts/update_completion
+++ b/debian/scripts/update_completion
@@ -1,6 +1,6 @@
#!/bin/bash
-
+mkdir -p tmp
BINNAMES=""
BINNAMES=$(find debian/irstlm/usr/lib/irstlm/bin/ -type f | sed -e 's#^.*/##' -e 's/[.]\(sh\|pl\)$//g' | tr "\n" " ")
@@ -16,19 +16,17 @@ _irstlm_get_cmds()
_irstlm()
{
- local cur conns
-
- [ -r /etc/ppp/peers/ ] || return 0
+ local cur cmds
COMPREPLY=()
cur=\${COMP_WORDS[\$COMP_CWORD]}
if [ \$COMP_CWORD -eq 1 ]; then
- conns="\$(_irstlm_get_cmds)"
- COMPREPLY=( \$(compgen -o filenames -W "\$conns" -- \$cur) )
+ cmds="\$(_irstlm_get_cmds)"
+ COMPREPLY=( \$(compgen -o filenames -W "\$cmds" -- \$cur) )
elif [ \$COMP_CWORD -eq 2 ] && [[ \${COMP_WORDS[1]} = "help" ]]; then
- conns="\$(_irstlm_get_cmds)"
- COMPREPLY=( \$(compgen -o filenames -W "\$conns" -- \$cur) )
+ cmds="\$(_irstlm_get_cmds)"
+ COMPREPLY=( \$(compgen -o filenames -W "\$cmds" -- \$cur) )
elif [ \$COMP_CWORD -ge 2 ] ; then
case \${COMP_WORDS[1]} in
EOF
@@ -36,8 +34,10 @@ EOF
find debian/irstlm/usr/lib/irstlm/bin/ -type f | while read bin
do
BINNAME=$(basename "$bin" | sed -e 's/[.]\(sh\|pl\)$//g')
- LD_LIBRARY_PATH=debian/libirstlm0/usr/lib/ "$bin" -h 2>&1 | cat > tmp/"$BINNAME"
+ IRSTLM=debian/irstlm/usr/lib/irstlm/ LD_LIBRARY_PATH=debian/libirstlm0/usr/lib/ "$bin" -h 2>&1 | cat > tmp/"$BINNAME"
cat tmp/"$BINNAME" | grep "^[[:space:]]*-" | sed -e 's/[(].*//g' -e 's/\([>]\).*/\1/g' -e 's/^[[:space:]]*\|[[:space:]]*$//g' | grep -v '^-h\([[:space:]]\|[[:space:]]*,\)' > tmp/"$BINNAME".preprocess
+ awk '(TMP > 0) { print $1 }; /^Parameters:/ { TMP=1 };' tmp/"$BINNAME" | sed -e 's/^.../-&/' -e 's/^../-&/' -e 's/:.*/=/' | grep -v '^--\?\(Help\|h\)=\?$' >> tmp/"$BINNAME".preprocess
+
cat tmp/"$BINNAME".preprocess | sed -e 's/[[:space:]]\+[^<\[[:space:]].*$//g' > tmp/"$BINNAME".preprocess2
# meld tmp/"$BINNAME".preprocess tmp/"$BINNAME".preprocess2
COMP_TEXT=$(cat tmp/"$BINNAME".preprocess2 | sed -e 's/[[:space:]]\+.*$//g' -e 's/=.*$/=/g' -e ':repeat; s/^\(-[^|]*\)[|]\([^=]*\)\(=\?\)$/\1\3\n\2\3/g; t repeat' | tr "\n" " "; echo)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/irstlm.git
More information about the debian-science-commits
mailing list