-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
36 lines (27 loc) · 1.19 KB
/
main.py
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
36
import os
import argparse
import src.snapshot_updater as su
def main():
parser = argparse.ArgumentParser(description='Update test snapshots')
parser.add_argument('--project', '-P', type=str, required=True,
help='Absolute path of the project (where go.mod file is located)')
parser.add_argument('--package', '-pkg', type=str, required=True,
help='Absolute path of the package')
parser.add_argument('--file', '-f', type=str, required=False,
help='Absolute path of a test file. If given, only tests belonging to this file will be processed.')
parser.add_argument('--verbose', '-v', action='store_true', default=False)
args = parser.parse_args()
projectDir = str(args.project)
print('Project dir: ', projectDir)
packageDir = str(args.package)
print('Package dir: ', packageDir)
if args.file is None:
filePath = ''
else:
filePath = str(args.file)
print('File path: ', filePath)
verbose = bool(args.verbose)
print('Verbose: ', verbose)
su.update(projectBaseDir=projectDir, packageDir=packageDir, filePath=filePath, verbose=verbose)
if __name__ == "__main__":
main()