commandlineparser / commandlineparser/commandline

Factory for multiple verbs

Aberta
#749 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

> [](https://github.com/JeanSebTr) **Comment by [JeanSebTr](https://github.com/JeanSebTr)**
> _Wednesday Apr 27, 2016 at 18:43 GMT_
>
> _...snip..._
>
> I'll check to clean that up and make a pull request (I've also added factory support to multi verb https://github.com/Emergensys/commandline/commit/2ebe156199f8bad3c0155c8c415e3363949941ff), but I'm a bit lost in the functional style.

I've got a `CLIOptions` class that takes an `IClock` instance as a constructor parameter, so I'm using the `ParseArguments` overload that accepts a `Func` to initialize the instance that gets populated.

I'd like to be able to subclass `CLIOptions` in order to build out a set of verbs, so I was looking for a way to use a factory with multiple verbs (the subclasses would need to receive the same constructor arguments). I didn't see anything obvious in the `Parser` class, but I stumbled across the quoted comment in https://github.com/commandlineparser/commandline/issues/70.

However, at this time https://github.com/Emergensys/commandline/commit/2ebe156199f8bad3c0155c8c415e3363949941ff is no longer available (or not public). I also wasn't able to find anything that I thought might be the PR @JeanSebTr is referring to in this repository.

Is multi-verb parsing with a factory a supported scenario?

Guia de contribuição

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

Direção de pesquisa

Comece lendo a classe Parser e a sobrecarga de ParseArguments que aceita um Func e, em seguida, compare esse caminho com o fluxo de parsing de múltiplos verbos. Revise a issue 70 e o commit referenciado da Emergensys para obter o contexto de design anterior. Considera-se concluído estabelecer se as factories podem inicializar várias subclasses de verbos com argumentos compartilhados do construtor e documentar ou implementar o comportamento suportado.

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

Avaliação

Stack de tecnologia
csharp
Domínio
cli
Tipo de issue
Funcionalidade
Dificuldade
5/5
Tempo estimado
Mais de uma semana
Status de atividade
Estagnada
Clareza
Precisa de esclarecimento
Facilidade para iniciantes
25/100

Receba novas issues na sua caixa de entrada

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