-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyreport.py
34 lines (30 loc) · 863 Bytes
/
pyreport.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
import getopt
import sys
argv = sys.argv[1:]
"""
try:
opts, args = getopt.getopt(argv, 'h:d', ['help', 'my_file='])
print(opts)
print(args)
except getopt.GetoptError:
#Print a message or do something useful
print('Something went wrong!')
sys.exit(2)
"""
options, remainder = getopt.gnu_getopt(
sys.argv[1:], 'o:v', ['output=', 'debug', 'variant=',])
print('OPTIONS :', options)
for opt, arg in options:
if opt in ('-o', '--output'):
print('Setting --output.')
output_file = arg
elif opt in ('-d', '--debug'):
print('Setting --debug.')
debug = True
elif opt == '--variant':
print('Setting --variant.')
variant = arg
print('VARIANT :', variant)
print('DEBUG :', debug)
print('OUTPUT :', output_file)
print('REMAINING :', remainder)