From ba45b8bb8b1efbe8559c420dccbdfe4c3c9cbd02 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 29 Nov 2014 21:12:16 -0500 Subject: emacs_getopt: have the caller capture the output --- common.sh | 10 +++++----- ediff.sh.in | 4 ++-- emacsmail.sh.in | 4 ++-- 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 -- cgit v1.2.3