38 lines
792 B
Python
38 lines
792 B
Python
#!/usr/bin/env python3
|
|
|
|
|
|
import sys
|
|
|
|
|
|
from commands import MergeRequests, UpdateAssignees, Comments, Merge, Test
|
|
from constants import SUBMISSIONS
|
|
|
|
|
|
COMMANDS = {
|
|
"mrs": MergeRequests,
|
|
"update-assignees": UpdateAssignees,
|
|
"comments": Comments,
|
|
"merge": Merge,
|
|
"test": Test,
|
|
}
|
|
|
|
|
|
def print_usage():
|
|
print("Usage:")
|
|
print("\tmrs\t\t\tFetch files and create merge requests for them")
|
|
print("\tupdate-assignees\tUpdate assignees on MRs")
|
|
print("\tcomments\t\tFetch all comments on MRs")
|
|
print("\tmerge\t\t\tMerge all MRs")
|
|
print("\ttest\t\t\tDebugging function")
|
|
|
|
|
|
def main():
|
|
if len(sys.argv) < 2 or sys.argv[1] not in COMMANDS:
|
|
print_usage()
|
|
exit(2)
|
|
|
|
COMMANDS[sys.argv[1]](SUBMISSIONS)()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|