X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/c23e93ff42f19ab5b2ff5701bbccbedb15882941..ddab48a5c0da11082de6fd3a530ee491f04aa19c:/stgit/commands/mail.py diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py index 45b2ca8..9f4b3d1 100644 --- a/stgit/commands/mail.py +++ b/stgit/commands/mail.py @@ -26,7 +26,7 @@ from stgit.config import config help = 'send a patch or series of patches by e-mail' -usage = """%prog [options] [] +usage = """%prog [options] [ [ 1: - parser.error('incorrect number of arguments') - if not config.has_option('stgit', 'smtpserver'): raise CmdException, 'smtpserver not defined' smtpserver = config.get('stgit', 'smtpserver') @@ -294,11 +291,11 @@ def func(parser, options, args): applied = crt_series.get_applied() - if len(args) == 1: - if args[0] in applied: - patches = [args[0]] - else: - raise CmdException, 'Patch "%s" not applied' % args[0] + if len(args) >= 1: + for patch in args: + if not patch in applied: + raise CmdException, 'Patch "%s" not applied' % patch + patches = args elif options.all: patches = applied elif options.range: