keys = [k for k in argv if k.startswith('--conf-')]
p = argparse.ArgumentParser()
for k in keys:
    p.add_argument(k, dest=foo(k))
print(vars(p.parse_args(argv)))
Create variable key/value pairs with argparse (python)