[hackers] [sob] complete_nick: be compatible with default ii out format || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Fri, 31 Oct 2014 14:46:05 +0100

commit 215516a8bfac89528bcdee472b89d18546504515
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Fri Oct 31 13:37:45 2014 +0000

    complete_nick: be compatible with default ii out format

diff --git a/scripts/complete_nick b/scripts/complete_nick
index ae3756a..3dd0068 100755
--- a/scripts/complete_nick
+++ b/scripts/complete_nick
_AT_@ -1,31 +1,31 @@
 #!/bin/sh
 
-file="$OUTFILE"
-test -f "$file" || exit 1
+file="${OUTFILE}"
+test -f "${file}" || exit 1
 
 grepword() {
         if test x"$1" = x""; then
- grep -oE '^[0-9\-]* (<[^>]*)' "$file" | sed 's_AT_^[0-9\-]* <@@g'
+ grep -oE '^[0-9\: \-]*(<[^>]*)' "${file}" | sed 's_AT_^[0-9\: \-]*<@@g'
         else
- grep -oE '^[0-9\-]* (<[^>]*)' "$file" | sed 's_AT_^[0-9\-]* <@@g' | grep -E "^$1"
+ grep -oE '^[0-9\: \-]*(<[^>]*)' "${file}" | sed 's_AT_^[0-9\: \-]*<@@g' | grep -E "^$1"
         fi
 }
 
-word="$SOBWRITE"
+word="${SOBWRITE}"
 
-#if test x"$DISPLAY" = x""; then
-# line=$(grepword "$word" | sort | uniq | slmenu -l 20)
+#if test x"${DISPLAY}" = x""; then
+# line=$(grepword "${word}" | sort | uniq | slmenu -l 20)
 #else
-# line=$(grepword "$word" | sort | uniq | dmenu -l 20)
+# line=$(grepword "${word}" | sort | uniq | dmenu -l 20)
 #fi
 
-matches=$(grepword "$word" | sort | uniq | wc -l)
-if test x"$matches" = x"1"; then
- line=$(grepword "$word" | tail -n 1)
+matches=$(grepword "${word}" | sort | uniq | wc -l)
+if test x"${matches}" = x"1"; then
+ line=$(grepword "${word}" | tail -n 1)
 else
- line=$(grepword "$word" | sort | uniq | dmenu -l 20)
+ line=$(grepword "${word}" | sort | uniq | dmenu -l 20)
 fi
 
-if test x"$line" != x""; then
- printf '%s' "$line"
+if test x"${line}" != x""; then
+ printf '%s' "${line}"
 fi
Received on Fri Oct 31 2014 - 14:46:05 CET

This archive was generated by hypermail 2.3.0 : Fri Oct 31 2014 - 14:48:09 CET