commandlineparser / commandlineparser/commandline

No error when parsing unknown arguments after verb

Aberta
#818 0 comentários 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

You can try this with your CLI program (replace `program.exe verb` as appropriate):

`program.exe verb unknownarg`

Replace unknownarg with any random inputs as long as they don't start with `-` and `Parser.Default.ParseArguments` will return `ParserResult.WithParsed`.

It doesn't matter what the value of `ParserSettings.IgnoreUnknownArguments` is.

I don't know if this is a bug or just hasn't been implemented but this is a fundamental problem with the built-in validation of this library.

Does anyone have any solutions to catch unknown args?

Guia de contribuição

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

Direção de pesquisa

Start by reproducing `program.exe verb unknownarg` through `Parser.Default.ParseArguments`, varying `ParserSettings.IgnoreUnknownArguments` as described. Trace the verb and positional-argument parsing path; the issue is done when an unknown argument is handled consistently with the intended validation behavior and the reported case is covered by a regression test.

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

Avaliação

Stack de tecnologia
csharp
Domínio
cli
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

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