Ejemplo n.º 1
0
    static void Main(string[] args)
    {
      Thread.CurrentThread.Name = "Main";

      // Parse Command Line options
      CommandLineOptions mpArgs = new CommandLineOptions();
      ICommandLineParser parser = new CommandLineParser(new CommandLineParserSettings(Console.Error));
      if (!parser.ParseArguments(args, mpArgs, Console.Out))
        Environment.Exit(1);

      targetDir = mpArgs.TargetDir;

      // always run verification first
      if (!Verify())
        Environment.Exit(2);

      if (mpArgs.Verify)
        Environment.Exit(0);

      if (mpArgs.ToCache)
      {
        UpdateTransifexConfig();
        CopyToCache();
      }

      if (mpArgs.Push)
        ExecutePush();

      if (mpArgs.Pull)
        ExecutePull();

      if (mpArgs.Fix)
        FixEncodings();

      if (mpArgs.FromCache)
        CopyFromCache();
    }
Ejemplo n.º 2
0
    static void Main(string[] args)
    {
      Thread.CurrentThread.Name = "Main";

      // Parse command line options
      var mpOptions = new CommandLineOptions();
      var parser = new CommandLine.Parser(with => with.HelpWriter = Console.Out);
      parser.ParseArgumentsStrict(args, mpOptions, () => Environment.Exit(1));

      targetDir = mpOptions.TargetDir;

      // always run verification first
      if (!Verify())
        Environment.Exit(2);

      if (mpOptions.Verify)
        Environment.Exit(0);

      if (mpOptions.ToCache)
      {
        UpdateTransifexConfig();
        CopyToCache();
      }

      if (mpOptions.Push)
        ExecutePush();

      if (mpOptions.Pull)
        ExecutePull();

      if (mpOptions.Fix)
        FixEncodings();

      if (mpOptions.FromCache)
        CopyFromCache();
    }