Ejemplo n.º 1
0
        public virtual int Run(string[] argv)
        {
            List <string> args = new List <string>();

            for (int j = 0; j < argv.Length; ++j)
            {
                args.AddItem(argv[j]);
            }
            DebugAdmin.DebugCommand command = PopCommand(args);
            if (command == null)
            {
                PrintUsage();
                return(0);
            }
            try
            {
                return(command.Run(args));
            }
            catch (IOException e)
            {
                System.Console.Error.WriteLine("IOException: " + StringUtils.StringifyException(e
                                                                                                ));
                return(1);
            }
            catch (RuntimeException e)
            {
                System.Console.Error.WriteLine("RuntimeException: " + StringUtils.StringifyException
                                                   (e));
                return(1);
            }
        }
Ejemplo n.º 2
0
 internal override int Run(IList <string> args)
 {
     DebugAdmin.DebugCommand command = this._enclosing.PopCommand(args);
     if (command == null)
     {
         this._enclosing.PrintUsage();
         return(0);
     }
     System.Console.Out.WriteLine(command.usageText);
     System.Console.Out.WriteLine(command.helpText + "\n");
     return(0);
 }