Exemplo n.º 1
0
        public static int Main(string[] args)
        {
            int result = 0;

            try
            {
                string unparsedScript = ParseCommandLine(args);

                CommandLibrary.FindCommands();

                OpsContext context = new OpsContext(CreateDevice());

                OpsScript script = new OpsScript(CommandLibrary, unparsedScript);

                script.Run(context);

                if (OpsConsole.Verbose)
                {
                    OpsConsole.WriteLine("Success");
                }
            }

            catch
            {
                OpsConsole.WriteLine("Application cannot continue due to errors.");
                result = -1;
            }
            finally
            {
                Close();
            }

            return(result);
        }
Exemplo n.º 2
0
        public static int Main(string[] args)
        {
            int result = 0;
            try
            {
                string unparsedScript = ParseCommandLine(args);

                CommandLibrary.FindCommands();

                OpsContext context = new OpsContext( CreateDevice());    

                OpsScript script = new OpsScript(CommandLibrary, unparsedScript);

                script.Run(context);

                if(OpsConsole.Verbose)
                    OpsConsole.WriteLine("Success");
            }

            catch
            {
                OpsConsole.WriteLine("Application cannot continue due to errors." );
                result = -1;
            }
            finally
            {
                Close();
            }

            return result;

        }