X-Git-Url: https://git.madduck.net/code/mailplate.git/blobdiff_plain/817a7c757fc641e02a6fc13e04a61d3307b0ce8b..21e948a069d5a416a4a714523dd03d432d25f02e:/mailplate diff --git a/mailplate b/mailplate index 439fc73..0cceef1 100755 --- a/mailplate +++ b/mailplate @@ -86,6 +86,7 @@ HELPER_SLOT_TRAILER = ')' # character ending a helper slot STD_HEADERS = ('From', 'To', 'Cc', 'Bcc', 'Subject', 'Reply-To', 'In-Reply-To') KEEP_HEADERS = { 'KEEP_FROM_HEADER' : STD_HEADERS[:1] , 'KEEP_STD_HEADERS' : STD_HEADERS[1:] + , 'KEEP_ALL_HEADERS' : STD_HEADERS } SIG_DELIM='\n-- \n' @@ -235,6 +236,7 @@ helpers = { 'get_quote' : 'fortune -s' } if not os.path.exists(CONFFILE): # conffile does not exist, let's create it with defaults. + options.verbose = True if not os.path.isdir(MAILPLATEDIR): info('configuration directory not found, creating: ' + MAILPLATEDIR) @@ -325,8 +327,11 @@ elif (options.auto or options.menu) and templname: sys.exit(posix.EX_USAGE) elif not templname and not (options.auto or options.menu): - err('no template specified') - sys.exit(posix.EX_USAGE) + if default_templname is not None: + templname = default_templname + else: + err('no template specified') + sys.exit(posix.EX_USAGE) elif options.menu: err('--menu mode not yet implemented') @@ -491,3 +496,4 @@ if options.edit: sys.exit(posix.EX_USAGE) os.execlp('sensible-editor', 'sensible-editor', outfname) +