summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-11-29 21:12:16 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-11-29 21:12:16 -0500
commitba45b8bb8b1efbe8559c420dccbdfe4c3c9cbd02 (patch)
treec7ab9e0d2b3f04ca4ca6e422f8902a05ed98ea87
parent3cc97ee0730b747e50c4365735cded88c2116966 (diff)
emacs_getopt: have the caller capture the output
-rw-r--r--common.sh10
-rw-r--r--ediff.sh.in4
-rw-r--r--emacsmail.sh.in4
3 files changed, 9 insertions, 9 deletions
diff --git a/common.sh b/common.sh
index 1348b96..3d8c3ec 100644
--- a/common.sh
+++ b/common.sh
@@ -93,11 +93,11 @@ emacs_getopt() {
declare l="$2"
shift 2
emacs_getopt_init
- args="$(getopt -a \
- -n "$0" \
- -o "${emacs_getopt_o}${o}" \
- -l "${emacs_getopt_l}${l:+,$l}" \
- -- "$@")"
+ getopt -a \
+ -n "$0" \
+ -o "${emacs_getopt_o}${o}" \
+ -l "${emacs_getopt_l}${l:+,$l}" \
+ -- "$@"
}
emacs_usage() {
diff --git a/ediff.sh.in b/ediff.sh.in
index b7c0088..8093fff 100644
--- a/ediff.sh.in
+++ b/ediff.sh.in
@@ -38,8 +38,8 @@ main() {
declare mode=normal
declare cmd=ediff
- declare args=
- emacs_getopt 3r recursive "$@" || error=true
+ declare args
+ args="$(emacs_getopt 3r recursive "$@")" || error=true
eval set -- "$args"
while true; do
case "$1" in
diff --git a/emacsmail.sh.in b/emacsmail.sh.in
index 7e4733b..6d160a6 100644
--- a/emacsmail.sh.in
+++ b/emacsmail.sh.in
@@ -35,8 +35,8 @@ main() {
declare error=false
declare mode=normal
- declare args=
- emacs_getopt '' '' "$@" || error=true
+ declare args
+ args="$(emacs_getopt '' '' "$@")" || error=true
eval set -- "$args"
while true; do
case "$1" in