Exemple #1
0
        private void WriteUsage(ICommandDefinition command = null)
        {
            ColorWrite(ConsoleColor.White, "Usage: ");
            ColorWrite(ConsoleColor.White, Path.GetFileName(Assembly.GetEntryAssembly().CodeBase));

            Console.Write(" ");
            ColorWrite(ConsoleColor.Cyan, command == null ? "command" : GetOrderedVerbs(command));

            ColorWrite(ConsoleColor.White, " [options]");
            Console.WriteLine();

            Console.WriteLine();
        }
Exemple #2
0
        private void ShowHelp(ICommandDefinition command, OptionSet set)
        {
            WriteUsage(command);

            set.WriteOptionDescriptions(Console.Out);
            Console.WriteLine();

            WriteHelpFooter();
        }
Exemple #3
0
        private void WriteHelpSection(ICommandDefinition command)
        {
            ColorWrite(HelpSectionHeaderColor, "  ");
            ColorWrite(HelpSectionHeaderColor, GetOrderedVerbs(command));

            if (command.IsDefault) ColorWrite(HelpSectionHeaderColor, " (default)");
            if (!String.IsNullOrWhiteSpace(command.Description)) ColorWrite(HelpSectionHeaderColor, ": " + command.Description);

            Console.WriteLine();
        }
Exemple #4
0
 private static string GetOrderedVerbs(ICommandDefinition command)
 {
     return String.Join("|", command.Verbs.OrderBy(_ => _));
 }