/// <summary> /// Remove '-',whitespace and change '?' alias to its internal real option name 'help' /// </summary> /// <returns></returns> internal static bool Test2() { CommandLineValidator cmdValidator = new CommandLineValidator(); string[] args = new string[] { " -? " }; cmdValidator.ValidateCommandLineArguments(ref args); if (args[0] == "help") return true; else return false; }
/// <summary> /// Try to set /reg with invalid arguments /// </summary> /// <returns></returns> internal static bool Test3() { CommandLineValidator cmdValidator = new CommandLineValidator(); string[] args = new string[] { "C:\\MyFile.dll", "/reg:foo" }; try { cmdValidator.ValidateCommandLineArguments(ref args); return false; } catch (RegAddinException) { return true; } catch (Exception) { throw; } }