示例#1
0
        private bool CheckHelp(CommandContext context, ConsoleCommand consoleCommand)
        {
            if (context.Get("help") == null || !context.Get <bool>("help"))
            {
                return(false);
            }

            context.Application.Writer.WriteLine(TemplateTransformer.TransformTemplate(consoleCommand, "CommandHelpTemplate"));

            return(true);
        }
        private void ShowCommandHelp(CommandContext context, ConsoleCommand consoleCommand)
        {
            if (consoleCommand != null)
            {
                var helpText = TemplateTransformer.TransformTemplate(consoleCommand, "CommandHelpTemplate");
                context.Application.Writer.WriteLine(helpText);
                return;
            }

            foreach (var helpCommand in context.Application.Commands)
            {
                if (helpCommand.HasName("help"))
                {
                    context.Application.Writer.WriteLine(TemplateTransformer.TransformTemplate(helpCommand, "CommandHelpTemplate"));
                }
            }
        }
 private void ShowAppHelp(CommandContext context)
 {
     context.Application.Writer.WriteLine(TemplateTransformer.TransformTemplate(context.Application, "ApplicationHelpTemplate"));
 }