Exemple #1
0
        public void ParseCmdLine(string[] args)
        {
            m_config = new BulkerConfig();

            CmdLineConfig cfg = new CmdLineConfig(new CmdLineSwitch[]
            {
                new CmdLineSwitch("R", false, false, "Record file", "Record file", null),
                new CmdLineSwitch("L", false, false, "Log file", "Log file", null),
                new CmdLineSwitch("C", false, false, "Cover source full path to root", "Cover source full path to root", null),
                new CmdLineSwitch("B", true, false, "Bulk update books", "Bulk update books", null),
                new CmdLineSwitch("Bs", true, false, "Update book summary (force)", "Summary", null),
                new CmdLineSwitch("D", true, false, "Bulk update dvds", "Bulk update dvds", null),
                new CmdLineSwitch("Ds", true, false, "Update dvd summary (force)", "Summary", null),
                new CmdLineSwitch("PW", true, false, "Show password", "show password for debugging purposes", null),
            });

            CmdLine cmdLine = new CmdLine(cfg);

            string sError;

            if (!cmdLine.FParse(args, m_config, null, out sError))
            {
                cmdLine.Usage(ConsoleWriteDelegate);
            }
        }
Exemple #2
0
        public void Awake()
        {
            var config = new CmdLineConfig();

            config.Hmm   = Application.dataPath + "\\UnitySphinx\\Models\\en-us\\en-us";
            config.Dict  = Application.dataPath + "\\UnitySphinx\\Models\\en-us\\cmudict-en-us.dict";
            config.Jsgf  = Application.dataPath + "\\UnitySphinx\\Demo\\Grammars\\demo.gram";
            config.Logfn = Application.dataPath + "\\sphinxlog.txt";

            _decoder = new PsDecoder(config);
        }
        public void WHEN_UsingCustomArgSeparator_AND_ArgIsInvalid_THEN_MethodIsNotExecuted() // AND_ErrorMessageIsDisplayed
        {
            var config = new CmdLineConfig {
                ArgSeparator = ':'
            };
            var args = new[] { "test3", "/count=2", "/list=1,2" };

            CmdLine <TestClassStatic> .Execute(args, config);

            TestClassStatic.GetMethodInvokedAndReset().Should().BeNull();
        }
        public void WHEN_UsingCustomArgSeparator_THEN_MethodIsExecuted()
        {
            var config = new CmdLineConfig {
                ArgSeparator = ':'
            };
            var args = new[] { "test3", "/count:1", "/list:1" };

            CmdLine <TestClassStatic> .Execute(args, config).Should().Be(0);

            TestClassStatic.GetMethodInvokedAndReset().Should().Be("test3");
            args = new[] { "test3", "/count:2", "/list:1,2" };
            CmdLine <TestClassStatic> .Execute(args, config).Should().Be(0);

            TestClassStatic.GetMethodInvokedAndReset().Should().Be("test3");
        }