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

Loading…
Cancel
Save