allow unquoted message by eating and joining the rest of the command line

This commit is contained in:
Josh Holtrop 2012-03-14 12:02:55 -04:00
parent 3ae494ea4d
commit dd8b49adad

View File

@ -15,11 +15,11 @@ def get_config(fname):
def main(argv): def main(argv):
config = {} config = {}
if len(argv) != 3: if len(argv) < 3:
sys.stderr.write('Usage: %s <config-file> <note>\n' % argv[0]) sys.stderr.write('Usage: %s <config-file> <note>\n' % argv[0])
return 1 return 1
config = get_config(argv[1]) config = get_config(argv[1])
message = argv[2] message = ' '.join(argv[2:])
if not ('server' in config and 'port' in config and 'user' in config if not ('server' in config and 'port' in config and 'user' in config
and 'password' in config and 'to_addr' in config and 'password' in config and 'to_addr' in config
and 'from_addr' in config): and 'from_addr' in config):