Skip to content

Commit

Permalink
bug in command line args
Browse files Browse the repository at this point in the history
  • Loading branch information
John Major committed Jun 20, 2021
1 parent 1f0421f commit 6bf0e29
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions bin/run_color_module_RGB_HSV_HEX_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@
# Col width, or num characters to print
col_width = os.get_terminal_size().columns
try:
if len(sys.argv) < 3:
sys.argv.append(col_width)
elif len(sys.argv) == 4:
if len(sys.argv) > 2:
if sys.argv[2] == "w":
pass
else:
Expand All @@ -95,7 +93,7 @@
j = "-r 0"

try:
if len(sys.argv) == 3:
if len(sys.argv) < 4:
no_newlines = " "
else:
no_newlines = sys.argv[3] + " "
Expand Down Expand Up @@ -128,7 +126,7 @@ def _write_color(color):
# just print colors
r = 1
if ri:
r = random.randint(2, 270)
r = random.randint(1, 54)
l = "X" * (col_width * r)
cmd = f"""colr {j} {no_newlines} "{l}" "{color.hex}" "{color.hex}" 2>/dev/null;"""
ret_code = os.system(cmd)
Expand Down

0 comments on commit 6bf0e29

Please sign in to comment.