Exemple #1
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));
            }
        }
 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));
     }
 }