2019-03-19 18:04:43 +01:00
|
|
|
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>')
|
2019-03-19 18:04:43 +01:00
|
|
|
sys.exit(2)
|
|
|
|
except getopt.GetoptError as err:
|
|
|
|
print(err)
|
|
|
|
sys.exit(2)
|