SZI2019SmieciarzWmi/utils.py

15 lines
358 B
Python
Raw Normal View History

import sys, getopt
def set_home_amount():
arguments = sys.argv[1:]
try:
optlist, args = getopt.getopt(arguments, '', ['home-count='])
for o, amount in optlist:
if o == '--home-count':
return int(amount)
2019-03-19 18:40:36 +01:00
print('Missing argument: --home-count <amount>')
sys.exit(2)
except getopt.GetoptError as err:
print(err)
sys.exit(2)