Skip to content

Commit

Permalink
Can specify message on command line.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmc committed Aug 1, 2011
1 parent 3e0532e commit 9fa98d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* Store new numbers as aliases
* All the features of Perl meteorsms!
* All the features of Perl meteorsms!
* Ensure config file and cookie file are not readable by other users
6 changes: 5 additions & 1 deletion meteorsms.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ def main():
usage = "usage: %prog [options] number"
parser = OptionParser(usage=usage)
parser.add_option("-d", "--debug", action="store_true", dest="debug",default=False)
parser.add_option("-m", "--message", metavar="STRING", help="Don't wait for STDIN, send this message", dest="text")
(options, args) = parser.parse_args()
global DEBUG
DEBUG = options.debug
Expand All @@ -250,8 +251,11 @@ def main():
print "[ recipient : %s (%s) ]" % (alias,number)
else:
print "[ recipient : %s ]" % number
text = sys.stdin.read()

if options.text:
text = options.text
else:
text = sys.stdin.read()

if text != "":
print "--sending--"
Expand Down

0 comments on commit 9fa98d2

Please sign in to comment.