home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- ##############################################################
- # Command: mozilla-thunderbird-compose <uri>
- # Options: uri : <empty>
- # : mailto:name@some.tld
- # : mailto:name@some.tld?Subject=SubjectText
- #
- # Author: Alexander Sack <asac@debian.org>
- ##############################################################
-
- print_usage() {
- echo " Usage: mozilla-thunderbird-compose [options] mailto:url"
- echo " e.g. mozilla-thunderbird-compose mailto:somemail@someaddress.tld"
- }
-
- _optOthers=
- _optLast=
- for i in "$@"; do
- _optLast="${i}"
- done #last arg
-
- for i in "$@"; do
- # break if last
- [ "$i" = "${_optLast}" ] && break
-
- # omit -compose
- [ "$i" != "'-compose'" ] && _optOthers="${_optOthers} ${i}"
- done #others arg
-
- if test "$_optLast" = "-?" -o "$_optLast" = "--help"; then
- print_usage
- exit 1
- fi
-
- /usr/bin/mozilla-thunderbird ${_optOthers} -compose $_optLast
-