diff options
| author | Barry Warsaw | 2011-06-15 08:24:14 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2011-06-15 08:24:14 -0400 |
| commit | 8a7ef34b079786ddeba73e8beba11af660d9433e (patch) | |
| tree | 17e967b0f970d2f38cb34a3d71c7c62a45605201 /src/mailman/commands/cli_inject.py | |
| parent | 65183dcce5e354957c29013ed148f0de24d6884f (diff) | |
| download | mailman-8a7ef34b079786ddeba73e8beba11af660d9433e.tar.gz mailman-8a7ef34b079786ddeba73e8beba11af660d9433e.tar.zst mailman-8a7ef34b079786ddeba73e8beba11af660d9433e.zip | |
Diffstat (limited to 'src/mailman/commands/cli_inject.py')
| -rw-r--r-- | src/mailman/commands/cli_inject.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mailman/commands/cli_inject.py b/src/mailman/commands/cli_inject.py index 1d019d9e0..a3e61e2a4 100644 --- a/src/mailman/commands/cli_inject.py +++ b/src/mailman/commands/cli_inject.py @@ -50,7 +50,7 @@ class Inject: self.parser = parser command_parser.add_argument( '-q', '--queue', - type=unicode, help=_("""\ + type=unicode, help=_(""" The name of the queue to inject the message to. QUEUE must be one of the directories inside the qfiles directory. If omitted, the incoming queue is used.""")) @@ -66,9 +66,16 @@ class Inject: # Required positional argument. command_parser.add_argument( 'listname', metavar='LISTNAME', nargs=1, - help=_("""\ + help=_(""" The 'fully qualified list name', i.e. the posting address of the mailing list to inject the message into.""")) + command_parser.add_argument( + '-m', '--metadata', + dest='keywords', action='append', default=[], metavar='KEY=VALUE', + help=_(""" + Additional metadata key/value pairs to add to the message metadata + dictionary. Use the format key=value. Multiple -m options are + allowed.""")) def process(self, args): """See `ICLISubCommand`.""" @@ -104,4 +111,8 @@ class Inject: else: with open(args.filename) as fp: message_text = fp.read() - inject_text(mlist, message_text, switchboard=queue) + keywords = {} + for keyvalue in args.keywords: + key, equals, value = keyvalue.partition('=') + keywords[key] = value + inject_text(mlist, message_text, switchboard=queue, **keywords) |
