commandlineparser / commandlineparser/commandline

Global parameters before verbs

Aberta
#799 1 comentário 4 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

So I want to do something like this:
```bash
$ app.exe
```
First argument is a value, and I want to make it global for every verb in app. For now it is implemented like this:
```c#
abstract class BaseOptions
{
[Value(0)]
public string file { get; set; }
}

[Verb("verb1")]
class Verb1Options : BaseOptions
{
[Option('a', "verb-1-option")]
public bool a{ get; set; }

[Option('b', "verb-1-another-option")]
public bool a{ get; set; }
}

[Verb("verb2")]
class Verb2Options : BaseOptions
{
[Option('c', "verb-2-option")]
public bool c{ get; set; }
}
```
But the issue is first goes verb then value. I need in reverse Can I do it?

Guia de contribuição

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

Direção de pesquisa

Start by tracing how the parser handles verb selection and positional Value attributes, using the command examples and BaseOptions hierarchy in the issue as the behavioral reference. Done means an invocation with the file path before the verb parses successfully and makes that value available to every verb without breaking verb-specific options.

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
Razoavelmente clara
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.