示例#1
0
        public void Verb()
        {
            var table = new OptTableBuilder()
                        .Add(new VerbOption(1, "action", helpText: "Action", metaVar: "<action>"))
                        .Add(new SeparateOption(2, "-", "name", helpText: "Name", metaVar: "foo"))
                        .Add(new SeparateOption(3, "-", "foo", helpText: "Bar", metaVar: "foo"))
                        .Add(new InputOption(4, metaVar: "foo"))
                        .CreateTable();

            var al = table.ParseArgs(new[] { "bar", "-name", "n" }, out var _);

            output.WriteLine("Help: {0}", table.GetHelp());
            output.WriteLine("{0}", al.Count);
            output.WriteLine("{0}", al[0]);
            output.WriteLine("{0}", al[1]);
        }