|
@ -55,7 +55,7 @@ cmds = { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
match_all_labels = [] |
|
|
match_all_labels = [] |
|
|
page = None |
|
|
|
|
|
def usage(): |
|
|
def usage(): |
|
|
print("") |
|
|
print("") |
|
|
print("Commands:") |
|
|
print("Commands:") |
|
@ -72,12 +72,17 @@ def usage(): |
|
|
print("") |
|
|
print("") |
|
|
print("") |
|
|
print("") |
|
|
|
|
|
|
|
|
|
|
|
page = None |
|
|
|
|
|
prev_arg = None |
|
|
match_number = None |
|
|
match_number = None |
|
|
for i in range(1, len(sys.argv)): |
|
|
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()): |
|
|
if (cmd is None) and (arg in cmds.keys()): |
|
|
|
|
|
# don't set the command to list unless the enclosing case is |
|
|
|
|
|
# true. If a label was specified, paging is handled in the |
|
|
|
|
|
# other case. |
|
|
if arg == "page": |
|
|
if arg == "page": |
|
|
cmd = "list" |
|
|
cmd = "list" |
|
|
else: |
|
|
else: |
|
@ -85,7 +90,7 @@ for i in range(1, len(sys.argv)): |
|
|
else: |
|
|
else: |
|
|
try: |
|
|
try: |
|
|
i = int(arg) |
|
|
i = int(arg) |
|
|
if cmd == "list": |
|
|
if prev_arg == "page": |
|
|
page = i |
|
|
page = i |
|
|
else: |
|
|
else: |
|
|
match_number = i |
|
|
match_number = i |
|
@ -93,7 +98,11 @@ for i in range(1, len(sys.argv)): |
|
|
if (cmd is None) and (cmds.get(arg) is not None): |
|
|
if (cmd is None) and (cmds.get(arg) is not None): |
|
|
cmd = arg |
|
|
cmd = arg |
|
|
else: |
|
|
else: |
|
|
match_all_labels.append(arg) |
|
|
if arg != "page": |
|
|
|
|
|
print("* adding criteria: {}".format(arg)) |
|
|
|
|
|
cmd = "list" |
|
|
|
|
|
match_all_labels.append(arg) |
|
|
|
|
|
prev_arg = arg |
|
|
if cmd is None: |
|
|
if cmd is None: |
|
|
if len(match_all_labels) > 1: |
|
|
if len(match_all_labels) > 1: |
|
|
cmd = "list" |
|
|
cmd = "list" |
|
@ -136,6 +145,7 @@ for s in match_all_labels: |
|
|
match_all_labels_lower.append(s.lower()) |
|
|
match_all_labels_lower.append(s.lower()) |
|
|
|
|
|
|
|
|
match_count = 0 |
|
|
match_count = 0 |
|
|
|
|
|
total_count = len(d) |
|
|
matching_issue = None |
|
|
matching_issue = None |
|
|
for issue in d: |
|
|
for issue in d: |
|
|
this_issue_labels_lower = [] |
|
|
this_issue_labels_lower = [] |
|
@ -171,6 +181,7 @@ for issue in d: |
|
|
# INFO: match_number & issue["number"] are ints |
|
|
# INFO: match_number & issue["number"] are ints |
|
|
if match_number == issue["number"]: |
|
|
if match_number == issue["number"]: |
|
|
matching_issue = issue |
|
|
matching_issue = issue |
|
|
|
|
|
|
|
|
if matching_issue is not None: |
|
|
if matching_issue is not None: |
|
|
print("") |
|
|
print("") |
|
|
print("#{} {}".format(issue["number"], issue["title"])) |
|
|
print("#{} {}".format(issue["number"], issue["title"])) |
|
@ -232,6 +243,16 @@ elif cmd == "list": |
|
|
match_count, |
|
|
match_count, |
|
|
" + ".join("'{}'".format(s) for s in match_all_labels) |
|
|
" + ".join("'{}'".format(s) for s in match_all_labels) |
|
|
)) |
|
|
)) |
|
|
|
|
|
if total_count >= 30: |
|
|
|
|
|
print("{} searched, which is the maximum number" |
|
|
|
|
|
" per page.".format(total_count)) |
|
|
|
|
|
next_page = 2 |
|
|
|
|
|
if page is not None: |
|
|
|
|
|
next_page = page + 1 |
|
|
|
|
|
print(" ./" + me + " " + " ".join(match_all_labels) |
|
|
|
|
|
+ " page " + str(next_page)) |
|
|
|
|
|
print("to see additional pages.") |
|
|
|
|
|
|
|
|
else: |
|
|
else: |
|
|
if page is not None: |
|
|
if page is not None: |
|
|
print("{} issue(s) are showing for page" |
|
|
print("{} issue(s) are showing for page" |
|
@ -240,12 +261,11 @@ elif cmd == "list": |
|
|
print("{} issue(s) are showing.".format(match_count)) |
|
|
print("{} issue(s) are showing.".format(match_count)) |
|
|
if match_count >= 30: |
|
|
if match_count >= 30: |
|
|
print("That is the maximum number per page. Type") |
|
|
print("That is the maximum number per page. Type") |
|
|
|
|
|
next_page = 2 |
|
|
if page is not None: |
|
|
if page is not None: |
|
|
print(" ./" + me + " page " + str(page+1)) |
|
|
next_page = page + 1 |
|
|
print("to see additional pages.") |
|
|
print(" ./" + me + " page " + str(next_page)) |
|
|
else: |
|
|
print("to see additional pages.") |
|
|
print(" ./" + me + " page") |
|
|
|
|
|
print("followed by a number to see additional pages.") |
|
|
|
|
|
if match_count > 0: |
|
|
if match_count > 0: |
|
|
print() |
|
|
print() |
|
|
print() |
|
|
print() |
|
|