summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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