コード例 #1
0
ファイル: Program.cs プロジェクト: yindongfei/bridge.lua
        static void Main(string[] args) {
            if(args.Length > 0) {
                try {
                    var cmds = Utility.GetCommondLines(args);
                    if(cmds.ContainsKey("-h")) {
                        ShowHelpInfo();
                        return;
                    }

                    string folder = cmds.GetArgument("-f");
                    string output = cmds.GetArgument("-p");
                    string bridge = cmds.GetArgument("-b", true);
                    string lib = cmds.GetArgument("-l", true);
                    string libWhite = cmds.GetArgument("-lw", true);
                    string libBlack = cmds.GetArgument("-lb", true);
                    Worker w = new Worker(folder, output, bridge, lib, libWhite, libBlack);
                    w.Do();
                    Console.WriteLine("all operator success");
                }
                catch(CmdArgumentException e) {
                    Console.Error.WriteLine(e.ToString());
                    Environment.ExitCode = -1;
                }
                catch(BridgeLuaException e) {
                    Console.Error.WriteLine(e.Message);
                    Environment.ExitCode = -1;
                }
                catch(Exception e) {
                    Console.Error.WriteLine(e.ToString());
                    Environment.ExitCode = -1;
                }
            }
            else {
                ShowHelpInfo();
                Environment.ExitCode = -1;
            }
        }