Exemplo n.º 1
0
        private void _args_PreParse(object?sender, PreParseEventArgs e)
        {
            var a = _args !;

            this.OnParseArguments?.Invoke(a, e);
            if (e.SubCommand == "help")
            {
                var man = new ManualBuilder(a);
                man.BuildFull(this.CommandUsages ?? Array.Empty <string>());
                _man = man.ToString();
            }
        }
Exemplo n.º 2
0
        public void ParseTest()
        {
            var conv = CLConvFactory.Create();

            conv.AddType <SwitchA>();
            conv.AddType <SwitchB>();
            conv.AddType <SwitchC>();
            var help = new ManualBuilder(conv);

            help.Build();
            Assert.AreEqual(
                Resources.CL_ManualBuilder_Result.Replace("\r\n", "\n").Replace("\n\r", "\n").Replace('\r', '\n'),
                help.ToString().Replace("\r\n", "\n").Replace("\n\r", "\n").Replace('\r', '\n')
                );
        }