summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-06-25 20:43:50 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-06-25 20:43:50 -0400
commitb11c69873e98643bc743a9b7794bf47a1f81fc58 (patch)
tree1689a0e1ae5d6723aa7167e5cc5c9894c183c003
parent5f29a477f190b9f4c0d3835574dfbcbad19d827c (diff)
emacsmail: don't require an argument
-rw-r--r--emacsmail.sh.in8
1 files 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