From df9b0d6f17dcd498458076dc5e0f9ffa10c44ef6 Mon Sep 17 00:00:00 2001 From: pux Date: Thu, 4 Feb 2021 15:16:23 +0100 Subject: remove mandatory msg arg for hex color test printc --- pyfarbpracht/printc.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'pyfarbpracht') 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) -- cgit v1.2.2-1-g5e49