diff options
Diffstat (limited to 'pyfarbpracht')
-rwxr-xr-x | pyfarbpracht/printc.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pyfarbpracht/printc.py b/pyfarbpracht/printc.py index 3ac38a2..28e5dd6 100755 --- a/pyfarbpracht/printc.py +++ b/pyfarbpracht/printc.py @@ -4,7 +4,7 @@ import sys import pyfarbpracht as fp def usage(): - print('usage: ' + sys.argv[0] + ' \"#abcdef\" msg') + print('usage: ' + sys.argv[0] + ' \"#abcdef\" [msg]') print('You need to escape the hex color') sys.exit(1) @@ -25,6 +25,10 @@ except: print('Color is not a valid hex string') sys.exit(1) -msg = sys.argv[2] +if len(sys.argv) < 3: + msg = color +else: + args = sys.argv[2:] + msg = ' ' .join(args) fp.printc(color, msg, enable_color=True) |