I am using CommandLine Parser Library to parse command line arguments within an application.
There are some options that will in most cases be the same every time a user runs the application. Usually, I use the DefaultValue attribute so that if the user does not provide a value a default one will be used.
[Option('a', "address", DefaultValue = "http://me.com", Required = false, HelpText = "Address of server.")]
public string Address{ get; set; }
The issue I am facing is that the default value is specific for a given deployment and needs to be configured after deployment. I would like the user/administrator to be able to set the default value of these options using a configuration file.
Does anyone know how to change the default value for an option at run time? Then when starting the application I can load the configuration file and set the default values accordingly.