Ntreev.Library.Commands.CommandLineParser.PrintUsage C# (CSharp) Method

PrintUsage() public method

public PrintUsage ( ) : void
return void
        public virtual void PrintUsage()
        {
            var switches = CommandDescriptor.GetSwitchDescriptors(this.instance).Where(item => this.IsSwitchVisible(item));
            this.SwitchUsagePrinter.Print(this.Out, switches.ToArray());
        }

Usage Example

 protected virtual void PrintUsage(ICommand command, CommandLineParser parser)
 {
     if (command.Types.HasFlag(CommandTypes.HasSubCommand) == true)
     {
         if (this.SubCommandName != string.Empty)
             parser.PrintMethodUsage(this.SubCommandName);
         else
             parser.PrintMethodUsage();
     }
     else
     {
         parser.PrintUsage();
     }
 }