So I’m stuck on the sys.argv part of this exercise. I can’t seem to figure out a smart way to look ahead to get the value of an optional argument.
Any suggestions on looking ahead while at say, --firstname to get its value
optargs_values = defaultdict(str)
optargs = {('-f', '--firstname'): 'firstname',
('-l', '--lastname'): 'lastname',
('-e', '--email'): 'email'}
files = []
def parse(args_ls):
if help[0] in args_ls or help[1] in args_ls:
print(USAGE)
else:
for arg in args_ls:
for (k,v) in optargs:
if arg==k or arg==v:
next_value = #pass