awesome-client: handle multiple args (#2551)
`awesome-client 'return 1' 'return 2'` would only run the first command. This also fixes other issues reported by shellcheck, and uses `read` directly to allow `shellcheck` to parse that construct correctly.
This commit is contained in:
parent
ac34a687c0
commit
f75dacb504
|
@ -17,12 +17,12 @@ then
|
||||||
then
|
then
|
||||||
if [ "$A_RERUN" = "" ]
|
if [ "$A_RERUN" = "" ]
|
||||||
then
|
then
|
||||||
A_RERUN="no" exec $AWESOME_RLWRAP $0 "$@"
|
A_RERUN="no" exec "$AWESOME_RLWRAP" "$0" "$@"
|
||||||
fi
|
fi
|
||||||
READ_CMD="read"
|
READ_ARGS=""
|
||||||
else
|
else
|
||||||
# No rlwrap: use bash's readline.
|
# No rlwrap: use bash's readline.
|
||||||
READ_CMD="read -e"
|
READ_ARGS="-e"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -76,13 +76,13 @@ then
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
# run arguments
|
# run arguments
|
||||||
for arg in "$ARGS" ; do
|
for arg in "${ARGS[@]}"; do
|
||||||
a_dbus_send "$arg"
|
a_dbus_send "$arg"
|
||||||
done
|
done
|
||||||
elif [ -t 0 ]
|
elif [ -t 0 ]
|
||||||
then
|
then
|
||||||
FATAL_ERRORS=0
|
FATAL_ERRORS=0
|
||||||
while $READ_CMD -p "awesome# " -r line
|
while read $READ_ARGS -p "awesome# " -r line
|
||||||
do
|
do
|
||||||
if [ "$line" = "" ]; then
|
if [ "$line" = "" ]; then
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue