예제 #1
0
        public static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(true);

            // Command & CVar core
            Core.Core.Init();

            // Parse Args
            Arguments           = new CLIArgs();
            PositionalArguments = CommandLineArgs.ParseArguments(Arguments, Environment.GetCommandLineArgs().Skip(1).ToArray());
            if (Arguments.Help)
            {
                return;
            }

            if (!Arguments.NormalPriority)
            {
                Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.BelowNormal;
            }

            // Load the config file
            if (!string.IsNullOrEmpty(Arguments.DaocRoot))
            {
                Config = new Config {
                    CEM = { GamePath = Arguments.DaocRoot }
                };
            }
            else
            {
                string cfgFile = Path.Combine("..", Arguments.ConfigFile);
                if (!File.Exists(cfgFile))
                {
                    Log.Fatal("Config file not found: {0}", Arguments.ConfigFile);
                    return;
                }
                Config = Config.Load(cfgFile);
            }

            // Load nif whitelist
            string ignorelistFile = Path.Combine("..", Arguments.IgnoreList);

            if (!File.Exists(ignorelistFile))
            {
                Log.Warn("NIF ignorelist file not found: {0}", Arguments.IgnoreList);
                NifIgnorelist = new List <string>();
            }
            else
            {
                NifIgnorelist = File.ReadAllLines(ignorelistFile).ToList();
            }

            BuildNavmeshes();
            Log.Normal("---------------------------------------------------------------------------");
            Log.Normal("All done.");
            Console.ReadKey();
        }
예제 #2
0
        public static void Main(string[] args)
        {
            var parsedCommandLine = CLIArgs.ProcessComandLineArguments(args).Where(kvp => kvp.Value != null);

            Console.WriteLine("Below is the following information you have provided.\n\nNOTE: If some of the vaues you have " +
                              "inputted are not shown below you may have included a non-existent parameter.");
            foreach (KeyValuePair <string, string> item in parsedCommandLine)
            {
                Console.WriteLine(item);
            }
        }
예제 #3
0
        public void ArgSplit1()
        {
            // Arrange
            CLIArgs CLIArgs = new CLIArgs();

            // Act
            List <Arg> args = CLIArgs.SplitArgs(@"--solution c:\abc\def\sol1");

            Assert.AreEqual(args[0].ArgName, "--solution");
            Assert.AreEqual(args[0].ArgValue, @"c:\abc\def\sol1");
        }
예제 #4
0
        public void ArgsMixStyle()
        {
            // Arrange
            CLIArgs CLIArgs = new CLIArgs();

            // Act
            List <Arg> args = CLIArgs.SplitArgs(@"-s c:\abc\def\sol1 --environment Env1");

            Assert.AreEqual(args[0].ArgName, "-s");
            Assert.AreEqual(args[0].ArgValue, @"c:\abc\def\sol1");

            Assert.AreEqual(args[1].ArgName, "--environment");
            Assert.AreEqual(args[1].ArgValue, "Env1");
        }
예제 #5
0
        public void ArgSplit2WithSpaces()
        {
            // Arrange
            CLIArgs CLIArgs = new CLIArgs();

            // Act
            List <Arg> args = CLIArgs.SplitArgs(@"  --solution  c:\abc\def\sol1    --environment  Env1");

            Assert.AreEqual(args[0].ArgName, "--solution");
            Assert.AreEqual(args[0].ArgValue, @"c:\abc\def\sol1");

            Assert.AreEqual(args[1].ArgName, "--environment");
            Assert.AreEqual(args[1].ArgValue, "Env1");
        }
        private void XParametersRadioButton_Checked(object sender, RoutedEventArgs e)
        {
            if (mCLIArgs == null)
            {
                mCLIArgs = new CLIArgs();
            }
            if (mAutoRunWizard != null)
            {
                mAutoRunWizard.AutoRunConfiguration.SelectedCLI = mCLIArgs;
                ShowHelp();
                ShowContent();
            }

            xConfigFileSettingsPnl.Visibility = Visibility.Collapsed;
        }
        private void XParametersRadioButton_Checked(object sender, RoutedEventArgs e)
        {
            xCLIContentTextBox.RemoveValidations(TextBox.TextProperty);

            if (mCLIArgs == null)
            {
                mCLIArgs = new CLIArgs();
            }
            if (mAutoRunWizard != null)
            {
                mAutoRunWizard.AutoRunConfiguration.SelectedCLI          = mCLIArgs;
                mAutoRunWizard.AutoRunConfiguration.AutoRunEexecutorType = eAutoRunEexecutorType.Run;

                ShowHelp();
                ResetCLIContent(mAutoRunWizard.ResetCLIContent = true);
                ShowContent();
            }
            xConfigFileSettingsPnl.Visibility = Visibility.Collapsed;
        }
예제 #8
0
파일: CommandLine.cs 프로젝트: qida/qcv
 private void Parse()
 {
     try {
     List<string> cli = Environment.GetCommandLineArgs().ToList();
     cli.RemoveAt(0);
     _args.filterlist_providers = _opts.Parse(cli);
       } catch (Exception err) {
     _logger.Error(String.Format("Failed to parse command line arguments - {0}", err.Message));
     _logger.Info("Use qcv.exe --help or browse to http://code.google.com/p/qcv/");
     _args = new CLIArgs();
       }
 }