/// <summary> /// Checks the command line params.<para/> /// arguments format: key=value or --key value /// </summary> /// <param name="args">The args.</param> public FlexibleOptions Parse(string[] args) { // 1. parse local configuration file // display the options listed in the configuration file FlexibleOptions localOptions = ParseAppSettings(); // 2. parse console arguments // parse arguments like: key=value FlexibleOptions argsOptions = ParseCommandLineArguments(args); // 3. merge arguments with app.config options. Priority: arguments > app.config Parsed = FlexibleOptions.Merge(localOptions, argsOptions); // 4. check for external config file // set config alias Parsed.SetAlias("config", "S3ConfigurationPath", "webConfigurationFile"); // load and parse web hosted configuration file (priority order: argsOptions > localOptions) ExternalFiles = Parsed.GetAsList("config", new char[] { ',', ';' }); FlexibleOptions externalLoadedOptions = ParseExternalFiles(ExternalFiles); // 5. merge options with the following priority: // 1. console arguments // 2. external file with json configuration object (local or web) // 3. local configuration file (app.config or web.config) Parsed = FlexibleOptions.Merge(Parsed, externalLoadedOptions, argsOptions); // return final merged options return(Parsed); }