-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ualg
executable file
·35 lines (29 loc) · 1.16 KB
/
ualg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3
import argparse
from commands import initialize, cat_file, hash_object, log, ls_tree, show_ref
argparser = argparse.ArgumentParser(description="A simple tool for tracking content")
argsubparsers = argparser.add_subparsers(title="Commands", dest="command")
argsubparsers.required = True
initialize.add_init_subparser(argsubparsers)
cat_file.add_cat_file_subparser(argsubparsers)
hash_object.add_hash_object_subparser(argsubparsers)
log.add_log_subparser(argsubparsers)
ls_tree.add_ls_tree_subparser(argsubparsers)
show_ref.add_show_ref_subparser(argsubparsers)
def main_execution():
# print("Hi from executable")
args = argparser.parse_args()
if args.command == "init":
initialize.initialize_command(args)
elif args.command == "cat-file":
cat_file.cmd_cat_file(args)
elif args.command == "hash-object":
hash_object.hash_object_command(args)
elif args.command == "log":
log.log_command(args)
elif args.command == "ls-tree":
ls_tree.list_files_in_tree(args)
elif args.command == "show-ref":
show_ref.display_references(args)
if __name__ == "__main__":
main_execution()