Exemple #1
0
        static void Main(string[] args)
        {
            CloudAdmin admin = new CloudAdmin();

            admin.SetPrompt("cloudb> ");
            admin.Interrupted += new EventHandler(CloudAdminInterrupted);

            Options options = new Options();

            admin.RegisterOptions(options);
            ICommandLineParser parser      = new GnuParser(options);
            CommandLine        commandLine = null;

            try {
                commandLine = parser.Parse(args);
            } catch (Exception e) {
                System.Console.Error.WriteLine("Error while parsing arguments: {0}", e.Message);
                Environment.Exit(1);
            }

            admin.HandleCommandLine(commandLine);

            try {
                admin.Run();
            } catch (Exception) {
                admin.Shutdown();
            }
        }
Exemple #2
0
        private static void CloudAdminInterrupted(object sender, EventArgs e)
        {
            CloudAdmin admin = (CloudAdmin)sender;

            admin.Exit(3);
        }