예제 #1
0
        public static int Main(string[] args)
        {
            int           result    = 1;
            CmdLineParams cmdParams = new CmdLineParams();

            if (cmdParams.Accepted)
            {
                try
                {
                    switch (cmdParams.Mode)
                    {
                    case CmdLineParams.CommandMode.ModeExtract:
                        VersionExtractor ve = new VersionExtractor(cmdParams);
                        ve.Run();
                        Console.WriteLine(ve.Version);
                        break;
                    }
                    result = 0;
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                    result = 1;
                }
            }
            else
            {
                cmdParams.ShowUsage();
            }
            return(result);
        }
예제 #2
0
 public VersionExtractor(CmdLineParams cmdParams)
 {
     this.cmdParams = cmdParams;
     this.Version   = String.Empty;
 }