I'm setting up a render farm that will be handling all sorts of jobs, with different arguments passed via command line. I'd rather not have to update the following params list every time I add a new command line parameter/kwarg. Is there a way to access the arguments being passed in with argparse without explicitly using add_argument for each kwarg?
params = ['type', 'action', 'renderDir', 'destination', 'computer', 'user', 'msg', 'data1']
parser = argparse.ArgumentParser()
for p in params:
parser.add_argument(f'-{p}', f'--{p}')
args = parser.parse_args()
For example, if I use command line to pass in -myParameter, I'd rather not have to add 'myParameter' to the params list in order to access args.myParameter. I'd also like to be able to access the keys as I iterate through args, so I have access both to the string 'myParameter' and to the value of args.myParameter.