Original title: What would be a suitable way to receive run-time arguments and combine them into an iterable object?

if name == "main": parser = argparse.ArgumentParser(description="Pick args") parser.add_argument("–all", help="Get endpoint", action="store_true") parser.add_argument("–endpoint1", help="Get endpoint1", action="store_true") parser.add_argument("–endpoint2", help="Get endpoint2", action="store_true") get_all = os.getenv("GET_ALL") == "YES" or args.all get_endpoint1 = os.getenv("GET_ENDPOINT1") == "YES" or get_all or args.endpoint1 get_endpoint2 = os.getenv("GET_ENDPOINT2") == "YES" or get_all or args.endpoint2 av = api_vendor.API() if get_all = TRUE or endpoint1 = TRUE: av.get_endpoint(endpoint1=TRUE) if get_all = TRUE or endpoint2 = TRUE: av.get_endpoint(endpoint2=TRUE)

Read the original question here