commandlineparser / commandlineparser/commandline

Add MapResult example to HelpText Configuration Wiki

Aberta
#602 1 comentário 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
C#
Estrelas
4.8k
Forks
478
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Please add the following example to the https://github.com/commandlineparser/commandline/wiki/HelpText-Configuration page.

```
class Program {
static int Main(string[] args) {
var parserResult = new Parser(c => c.HelpWriter = null).ParseArguments(args);
return parserResult.MapResult(
(Options opts) => new Run(opts),
errs => DisplayHelp(parserResult, errs)
);
}

static int DisplayHelp(ParserResult parserResult, IEnumerable errs) {
Console.WriteLine(HelpText.AutoBuild(parserResult, h => {
h.AddPreOptionsLine(Environment.NewLine + "Use this tool wisely!");
return h;
}));
return 1;
}
}
```

Also I had a great trouble finding this page, please add more links to it.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Open the HelpText Configuration wiki page linked in the issue and review its existing examples and navigation links. Add the supplied C# MapResult example and improve discoverability with additional links to the page. Done means the example and links are visible and correctly formatted on the wiki page.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
csharp
Domínio
documentation
Tipo de issue
Documentação
Dificuldade
1/5
Tempo estimado
Menos de uma hora
Status de atividade
Estagnada
Clareza
Claramente especificada
Facilidade para iniciantes
55/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.