예제 #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);
        }
예제 #2
0
        private static void PrintHelp(ICliContext context)
        {
            IHelpWriter helpTextWriter = new DefaultHelpWriter(context);

            helpTextWriter.Write();
        }