diff options
author | pux <pux@pux.dom> | 2021-02-04 15:16:23 +0100 |
---|---|---|
committer | pux <pux@pux.dom> | 2021-02-04 15:16:23 +0100 |
commit | df9b0d6f17dcd498458076dc5e0f9ffa10c44ef6 (patch) | |
tree | 2b63337bafc50ac79bbb670bbc3c9d5bc30ae1e8 | |
parent | fefe77825d02c6b4c801ee3d69726f52663e368f (diff) | |
download | pyfarbpracht-df9b0d6f17dcd498458076dc5e0f9ffa10c44ef6.tar.gz pyfarbpracht-df9b0d6f17dcd498458076dc5e0f9ffa10c44ef6.tar.bz2 pyfarbpracht-df9b0d6f17dcd498458076dc5e0f9ffa10c44ef6.zip |
remove mandatory msg arg for hex color test printc
-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) |