Ejemplo n.º 1
0
        public void Execute()
        {
            Document doc;
            var group = _start as CommandGroup;
            if (group != null)
            {
                doc = GroupHelp(group);
            }
            else
            {
                var command = _start as Command;
                if (command != null)
                {
                    doc = CommandHelp(command);
                }
                else
                {
                    throw new Exception("Unhandled case within internal help command!");
                }
            }

            ConsoleFormatter formatter = new ConsoleFormatter();
            formatter.Format(doc);
        }
Ejemplo n.º 2
0
 // TODO - styles should inherit from their parent - test that
 private IList<string> Render(Document doc, int width = 80)
 {
     var console = new MockConsole(width);
     var formatter = new ConsoleFormatter(console);
     formatter.Format(doc);
     return console.Result;
 }