commandlineparser / commandlineparser/commandline
All options optional in one of sets
- Linguagem predominante
- C#
- Estrelas
- 4.8k
- Forks
- 478
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
**Describe the bug**
I have two parameter sets. One has only one option, bool list, works fine:
`mytool new --list # works fine`
The other set works fine, while it has at least one required option
`mytool new --template "default"`
But I want all the options in my second set to be optional. I'd like to run
`mytool new`
and expect the second set is picked up, with "template" option set to "default". I cannot achieve it.
**To Reproduce**
https://dotnetfiddle.net/VE1xFs
**Expected behavior**
When one of the sets has all options optional, with defaults, it is automatically picked when no command-line arguments are provided.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
Start with the linked .NET Fiddle reproducer and compare parameter-set selection when no arguments are supplied with selection when a required option is present. Trace how the parser handles an all-optional set and its defaults. Done means `mytool new` selects that set with `template` set to `default`, while the existing required-option and `--list` cases continue to work.
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
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100