Browse Source

Fix list feature.

master
poikilos 5 years ago
committed by Jacob Gustafson
parent
commit
23d8f00637
  1. 11
      utilities/enissue.py

11
utilities/enissue.py

@ -70,6 +70,10 @@ for i in range(1, len(sys.argv)):
arg = sys.argv[i]
if arg.startswith("#"):
arg = arg[1:]
if (cmd is None) and (arg in cmds.keys()):
cmd = arg
print("* mode set to {}".format(cmd))
else:
try:
match_number = int(arg)
except ValueError:
@ -143,6 +147,10 @@ for issue in d:
if this_issue_match_count == len(match_all_labels):
match_count += 1
print("#{} {}".format(issue["number"], issue["title"]))
elif match_number is None:
# Show all since no criteria is set.
match_count += 1
print("#{} {}".format(issue["number"], issue["title"]))
if match_number is not None:
# INFO: match_number & issue["number"] are ints
if match_number == issue["number"]:
@ -201,10 +209,13 @@ if cmd == "labels":
print("The repo has {} label(s).".format(len(labels)))
elif cmd == "list":
print()
if len(match_all_labels) > 0:
print("{} issue(s) matched {}".format(
match_count,
" + ".join("'{}'".format(s) for s in match_all_labels)
))
else:
print("{} issue(s) are showing.".format(match_count))
if match_count > 0:
print()
print()

Loading…
Cancel
Save