Exemplo n.º 1
0
        /// <exception cref="System.Exception"/>
        private string RunCmd(string[] cmd)
        {
            ByteArrayOutputStream bytes  = new ByteArrayOutputStream();
            TextWriter            @out   = new TextWriter(bytes);
            TextWriter            oldErr = System.Console.Error;
            TextWriter            oldOut = System.Console.Out;

            Runtime.SetErr(@out);
            Runtime.SetOut(@out);
            int ret;

            try
            {
                ret = admin.Run(cmd);
            }
            finally
            {
                Runtime.SetErr(oldErr);
                Runtime.SetOut(oldOut);
                IOUtils.CloseStream(@out);
            }
            return("ret: " + ret + ", " + bytes.ToString().ReplaceAll(Runtime.GetProperty("line.separator"
                                                                                          ), string.Empty));
        }
Exemplo n.º 2
0
        /// <exception cref="System.IO.IOException"/>
        public static void Main(string[] argsArray)
        {
            DebugAdmin debugAdmin = new DebugAdmin(new Configuration());

            System.Environment.Exit(debugAdmin.Run(argsArray));
        }