What I'm trying to do is load a list of custom variables depending upon whether I want to run against my production server or my development server. The program that I'm writing uses argparser to parse the arguments username, server_ip, server_version, and optionally, a password. I would like to modify the launch.json file to specify whether I'm running this configuration against prod or dev, and depending upon which, loads the variables from its respective file.
Any recommendations? Thanks in advance!
I've tried using the envFile functionality and then just setting argparse to call os.environ.get() for each respective argument's default, but I had to specify nargs='?' which with multiple positional arguments, I feel like would cause issues if one happened to be omitted.
With the extension Command Variable and the command extension.commandvariable.pickStringRemember
you can pick an item in the pick list prod
or dev
that set a number of things to remember. And then use extension.commandvariable.remember
and use the values stored in strings of the args
argument of the launch config
See the example: task that picks multiple values