public static void ApplyArgument(string arg) { char[] splitter = { '=' }; string[] sp = arg.ToLower().Split(splitter); if (sp.Length == 1) { ApplyArgumentsInFile(arg); return; } else if (sp.Length != 2) { throw new InvalidParameterException("Invalid command-line argument " + arg); } string parameter = sp[0]; string value = sp[1]; if (CommonParams.ApplyArgument(parameter, value)) { return; } if (String.Compare(parameter, "secretLength", StringComparison.OrdinalIgnoreCase) == 0) { Parameters.secretLength = Convert.ToInt32(value); return; } throw new InvalidParameterException("Invalid command-line parameter " + parameter); }
public static void ApplyArgument(string arg) { char[] splitter = { '=' }; string[] sp = arg.ToLower().Split(splitter); if (sp.Length == 1) { ApplyArgumentsInFile(arg); return; } else if (sp.Length != 2) { throw new InvalidParameterException("Invalid command-line argument " + arg); } string parameter = sp[0]; string value = sp[1]; if (CommonParams.ApplyArgument(parameter, value)) { return; } throw new InvalidParameterException("Invalid command-line parameter " + parameter); }