Exemplo n.º 1
0
        public static string CreateAvailableCommandsHelpText()
        {
            var catalog = new CommandCatalog();
            var lines   =
                from command in catalog
                let optionsType = CommandCatalog.GetOptionsType(command)
                                  let options                                                           = Activator.CreateInstance(optionsType)
                                                                       let name                         = CommandCatalog.GetCommandName(command)
                                                                                              let title = Prompt.GetAppTitle(options)
                                                                                                          orderby name
                                                                                                          select new[] {
                name,
                ' '.Replicate(12) + title
            };
            var text = lines.SelectMany().JoinLines();

            return(text);
        }