From b11c69873e98643bc743a9b7794bf47a1f81fc58 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 25 Jun 2016 20:43:50 -0400 Subject: emacsmail: don't require an argument --- emacsmail.sh.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/emacsmail.sh.in b/emacsmail.sh.in index f1a3e1c..0cec264 100644 --- a/emacsmail.sh.in +++ b/emacsmail.sh.in @@ -20,7 +20,7 @@ m4_include(common.sh.in) usage() { - print 'Usage: %q [OPTIONS] MAILTO_URL' "$0" + print 'Usage: %q [OPTIONS] [MAILTO_URL]' "$0" print 'Use Emacs to open RFC 2368 "mailto:" URLs' echo print 'Yes, I know that RFC 2368 is obsoleted by RFC 6068.' @@ -56,7 +56,11 @@ main() { done urls=("$@") if [[ $mode == normal ]]; then - [[ ${#urls[@]} = 1 ]] || mode=error + case ${#urls[@]} in + 0) urls=('mailto:');; + 1) :;; + *) mode=error;; + esac fi fi -- cgit v1.2.3-2-g168b