Example #1
0
        private int?Execute(CliContext context)
        {
            // Get input and command schema from context
            CommandInput  input         = context.Input;
            CommandSchema commandSchema = context.CommandSchema;

            // Help option
            if ((commandSchema.IsHelpOptionAvailable && input.IsHelpOptionSpecified) ||
                (commandSchema == StubDefaultCommand.Schema && !input.Parameters.Any() && !input.Options.Any()))
            {
                IHelpWriter helpTextWriter = new DefaultHelpWriter(context);
                helpTextWriter.Write(commandSchema, context.CommandDefaultValues);

                return(ExitCodes.Success);
            }

            return(null);
        }
        private static void PrintHelp(ICliContext context)
        {
            IHelpWriter helpTextWriter = new DefaultHelpWriter(context);

            helpTextWriter.Write();
        }