AAA.Program.Main C# (CSharp) Метод

Main() статический приватный метод

static private Main ( string args ) : void
args string
Результат void
        static void Main(string[] args)
        {
            bool showHelp = false;
            bool install = false;
            bool uninstall = false;
            string pnkbstrFile = null;
            string serviceName = null;
            var p = new OptionSet() {
                { "i|install",
                  "install pnkbstrA|B.",
                   v => install = v != null },
                { "u|uninstall",
                  "uninstall pnkbstrA|B.",
                  v => uninstall = v != null},
                { "s|service=",
                  "service name pnkbstrA|B.",
                  v => serviceName = v},
                { "f|file=",
                  "the path to pnkbstrA|B.exe.",
                  v => pnkbstrFile = v },
                { "h|?|help",  "show this message and exit",
                  v => showHelp = v != null },
            };
            try
            {
                p.Parse(args);
                if (showHelp || (install == false && uninstall == false))
                {
                    ShowHelp(p, null);
                    return;
                }
                if (serviceName == null || serviceName.Equals(""))
                {
                    ShowHelp(p, "ERROR! Service name is required (should be pnkbstra or pnkbstrb)");
                    return;
                }

                if (install)
                {
                    if ((pnkbstrFile == null || pnkbstrFile.Equals("")))
                    {
                        ShowHelp(p, "ERROR! Path to PnkBstrA|B.exe is required!");
                        return;
                    }
                    Console.WriteLine("Installing {0} using exe {1}", serviceName, pnkbstrFile);
                    InstallPnkBstr(p, pnkbstrFile, serviceName);
                }
                else if (uninstall)
                {
                    UninstallPnkBstr(serviceName);
                }

            }
            catch (OptionException e)
            {
                Console.WriteLine("Try `AAA --help' for more information {0}.", e.Message);
                return;
            }
        }