public static void Describe(CommandLineInterpreterConfiguration config, ConsoleAdapter console, string applicationName, CommandLineParserConventions conventions) { CommandDescriber.Describe(config, console, applicationName, CommandExecutionMode.CommandLine); var adorner = MakeAdorner(conventions); foreach (var baseCommandConfig in config.Commands) { console.WriteLine(); console.WriteLine("Description of {0} command:", baseCommandConfig.Name); CommandDescriber.Describe(baseCommandConfig, console, CommandExecutionMode.CommandLine, adorner); } }
private static IOptionNameHelpAdorner MakeAdorner(CommandLineParserConventions conventions) { switch (conventions) { case CommandLineParserConventions.MicrosoftStandard: return new MicrosoftStandardCommandLineParser(); case CommandLineParserConventions.MsDosConventions: return new MsDosCommandLineParser(); case CommandLineParserConventions.PosixConventions: return new PosixCommandLineParser(); default: throw new ArgumentException(string.Format("Only built in conventions are supported.")); } }
public static ICommandLineParser Get(CommandLineParserConventions convention) { switch (convention) { case CommandLineParserConventions.MicrosoftStandard: return new MicrosoftStandardCommandLineParser(); case CommandLineParserConventions.MsDosConventions: return new MsDosCommandLineParser(); case CommandLineParserConventions.PosixConventions: return new PosixCommandLineParser(); default: Debug.Assert(false, "Internal error: unknown command line parser selected."); return null; } }