public override void Parse(string arg) { if (arg.StartsWith("--find:case", StringComparison.InvariantCultureIgnoreCase)) { this.findOptions = Wildcard.WildcardOptions.None; } else if (arg.StartsWith("--find:nocase", StringComparison.InvariantCultureIgnoreCase)) { this.findOptions = Wildcard.WildcardOptions.IgnoreCase; } else if (arg.StartsWith("--find:container=", StringComparison.InvariantCultureIgnoreCase)) { string argValue = arg.Substring("--find:container=".Length); if (argValue.IsEmpty()) { FatalError(String.Format("Invalid name ({0}); use 'APPDATA {1} --help' for usage", arg, GetCommandName())); } this.findContainerName = argValue; } else if (arg.StartsWith("--find:value=", StringComparison.InvariantCultureIgnoreCase)) { string argValue = arg.Substring("--find:value=".Length); if (argValue.IsEmpty()) { FatalError(String.Format("Invalid key ({0}); use 'APPDATA {1} --help' for usage", arg, GetCommandName())); } this.findValueKey = argValue; } else if (arg.Equals("-r", StringComparison.InvariantCultureIgnoreCase) || arg.Equals("--recurse", StringComparison.InvariantCultureIgnoreCase)) { this.recurse = true; } else if (arg.StartsWith("--type=", StringComparison.InvariantCultureIgnoreCase)) { string argValue = arg.Substring("--type=".Length); try { this.matchType = AppDataType.ToAppDataType(argValue); } catch (NotSupportedException) { FatalError(String.Format("Unknown type ({0}); use 'APPDATA {1} --help' for usage", arg, GetCommandName())); } } else if (arg.StartsWith("--value=", StringComparison.InvariantCultureIgnoreCase)) { string argValue = arg.Substring("--value=".Length); if (argValue.IsEmpty()) { FatalError(String.Format("Invalid key ({0}); use 'APPDATA {1} --help' for usage", arg, GetCommandName())); } this.matchValueKey = argValue; } else { base.Parse(arg); } }
public override void Parse(string arg) { if (arg.StartsWith("--data=", StringComparison.InvariantCultureIgnoreCase)) { this.dataAsString = arg.Substring("--data=".Length); } else if (arg.Equals("--overwrite:no", StringComparison.InvariantCultureIgnoreCase)) { this.overwrite = Overwrite.No; } else if (arg.Equals("--overwrite:prompt", StringComparison.InvariantCultureIgnoreCase)) { this.overwrite = Overwrite.Prompt; } else if (arg.Equals("--overwrite:yes", StringComparison.InvariantCultureIgnoreCase)) { this.overwrite = Overwrite.Yes; } else if (arg.StartsWith("--type=", StringComparison.InvariantCultureIgnoreCase)) { string argValue = arg.Substring("--type=".Length); try { this.dataType = AppDataType.ToAppDataType(argValue, supportedAppDataTypes); } catch (NotSupportedException) { FatalError(String.Format("Unknown type ({0}); use 'APPDATA {1} --help' for usage", arg, GetCommandName())); } } else if (arg.StartsWith("--value=", StringComparison.InvariantCultureIgnoreCase)) { string argValue = arg.Substring("--value=".Length); if (argValue.IsEmpty()) { FatalError(String.Format("Invalid key ({0}); use 'APPDATA {1} --help' for usage", arg, GetCommandName())); } this.valueKey = argValue; } else { base.Parse(arg); } }