Пример #1
0
        public CommandLineException(CommandArgumentHelp argumentHelp, Exception inner)
            : base(CheckNotNull(argumentHelp).Message, inner)
        {
            ArgumentHelp = argumentHelp;

            SubscribeToSerializeObjectState();
        }
        public CommandLineException(CommandArgumentHelp argumentHelp, Exception inner)
            : base(CheckNotNull(argumentHelp).Message, inner)
        {
            ArgumentHelp = argumentHelp;

            SubscribeToSerializeObjectState();
        }
 private static CommandArgumentHelp CheckNotNull(CommandArgumentHelp argumentHelp)
 {
     if (argumentHelp == null)
     {
         throw new ArgumentNullException("argumentHelp");
     }
     return argumentHelp;
 }
Пример #4
0
 private static CommandArgumentHelp CheckNotNull(CommandArgumentHelp argumentHelp)
 {
     if (argumentHelp == null)
     {
         throw new ArgumentNullException("argumentHelp");
     }
     return(argumentHelp);
 }
 public CommandLineHelpException(CommandArgumentHelp argumentHelp, Exception inner)
     : base(argumentHelp, inner)
 {
     ArgumentHelp = argumentHelp;
 }
 public CommandLineHelpException(CommandArgumentHelp argumentHelp)
     : base(argumentHelp.Message)
 {
     ArgumentHelp = argumentHelp;
 }
Пример #7
0
 public CommandLineHelpException(CommandArgumentHelp argumentHelp, Exception inner)
     : base(argumentHelp, inner)
 {
     this.ArgumentHelp = argumentHelp;
 }
Пример #8
0
 public CommandLineHelpException(CommandArgumentHelp argumentHelp)
     : base(argumentHelp.Message)
 {
     this.ArgumentHelp = argumentHelp;
 }
 public CommandLineException(CommandArgumentHelp argumentHelp, Exception inner)
     : base(argumentHelp.Message, inner)
 {
     ArgumentHelp = argumentHelp;
 }
Пример #10
0
 public CommandLineException(CommandArgumentHelp argumentHelp, Exception inner)
     : base(argumentHelp.Message, inner)
 {
     ArgumentHelp = argumentHelp;
 }
Пример #11
0
        static void Main(string[] args)
        {
            try
            {
                var arguments = CommandLine.Parse<ConnectArgs>();
                if (arguments.fix || arguments.show)
                {
                    Elevate(arguments);
                }
                else if (arguments.show)
                {

                }
                else
                {
                    var help = new CommandArgumentHelp(typeof(ConnectArgs));
                    Console.WriteLine(help.Message);
                    Console.WriteLine(help.GetHelpText(Console.BufferWidth));

                }
            }
            catch (CommandLineException exception)
            {
                Console.WriteLine(exception.ArgumentHelp.Message);
                Console.WriteLine(exception.ArgumentHelp.GetHelpText(Console.BufferWidth));
            }
        }
Пример #12
0
 private static void ShowHelp(CommandLineException exception = null)
 {
     if (exception != null)
     {
         Console.WriteLine(exception.ArgumentHelp.Message);
         Console.WriteLine(exception.ArgumentHelp.GetHelpText(Console.BufferWidth));
     }
     else
     {
         var help = new CommandArgumentHelp(typeof (RecycleCommands));
         Console.WriteLine(help.GetHelpText(Console.BufferWidth));
     }
 }