From faa2470ed5abedc289449975898950fd0b9224be Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 27 Nov 2012 13:34:05 -0500 Subject: [PATCH] send_message: Accept subject and message arguments. (imported from commit 93aca5e750fa74d7ee95d8a00adbf6d4e61b2fc8) --- examples/send-message | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/send-message b/examples/send-message index 1d83bb8..15ee25d 100755 --- a/examples/send-message +++ b/examples/send-message @@ -25,16 +25,18 @@ import sys from os import path import optparse -usage = """send-message [options] +usage = """send-message [options] Sends a test message to the specified recipients. -Example: send-message --sender=you@example.com --type=stream commits +Example: send-message --sender=you@example.com --type=stream commits --subject="my subject" --message="test message" Example: send-message --sender=you@example.com --site=https://zephyr.humbughq.com user1@example.com user2@example.com """ parser = optparse.OptionParser(usage=usage) parser.add_option('--api-key') parser.add_option('--sender') +parser.add_option('--subject', default="test") +parser.add_option('--message', default="test message") parser.add_option('--site', default='https://humbughq.com') parser.add_option('--type', default='private') (options, args) = parser.parse_args() @@ -51,8 +53,8 @@ client = api.common.HumbugAPI(email=options.sender, message_data = { "type": options.type, - "content": "test", - "subject": "test", + "content": options.message, + "subject": options.subject, "to": args, } print client.send_message(message_data)