aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-08-18 17:52:25 +0200
committerMattias Andrée <maandree@operamail.com>2012-08-18 17:52:25 +0200
commit6e754c5509228f7c9b7d2aa3eca0ab6fb4e211d6 (patch)
tree0c2a015bfd07efaedd9058df04098758c7a3e670
parent5ff733fddac0d682a25acf8bd3f6de4339d6c9f7 (diff)
downloadponysay-6e754c5509228f7c9b7d2aa3eca0ab6fb4e211d6.tar.gz
ponysay-6e754c5509228f7c9b7d2aa3eca0ab6fb4e211d6.tar.bz2
ponysay-6e754c5509228f7c9b7d2aa3eca0ab6fb4e211d6.zip
wrap support
-rwxr-xr-xponysay.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ponysay.py b/ponysay.py
index adc1264..23e8f39 100755
--- a/ponysay.py
+++ b/ponysay.py
@@ -67,11 +67,12 @@ Argument parsing
'''
parser = argparse.ArgumentParser(description = 'Ponysay, like cowsay with ponies')
-parser.add_argument('-v', '--version', action = 'version', version = '%s %s' % ('ponysay', VERSION))
+parser.add_argument('-v', '--version', action = 'version', version = '%s %s' % ('ponysay', VERSION))
parser.add_argument('-l', '--list', action = 'store_true', dest = 'list', help = 'list pony files')
parser.add_argument('-L', '--altlist', action = 'store_true', dest = 'linklist', help = 'list pony files with alternatives')
parser.add_argument( '--quoters', action = 'store_true', dest = 'quoters', help = 'list ponies with quotes (visible in -l and -L)') # for shell completions
parser.add_argument( '--onelist', action = 'store_true', dest = 'onelist', help = 'list pony files in one columns') # for shell completions
+parser.add_argument('-W', '--wrap', action = 'store', dest = 'wrap', help = 'specify the column when the message should be wrapped')
parser.add_argument('-f', '--pony', action = 'append', dest = 'pony', help = 'select a pony (either a file name or a pony name)')
parser.add_argument('message', nargs = '?', help = 'message to ponysay')
@@ -322,7 +323,7 @@ class ponysay():
if "think.py" in __file__: cmd = 'cowthink'
else: cmd = 'cowsay'
- os.system(cmd + ' -f ' + pony + ' \'' + msg + '\'')
+ os.system(cmd + (' -W ' + args.wrap if args.wrap is not None else '') + ' -f ' + pony + ' \'' + msg + '\'')