Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Add "choices" parameter to argument and option as in argparse

Aberta
#89 0 comentários 4 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

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

Direção de pesquisa

Start by locating the argument and option functions and tracing how they validate values and generate --help and help output. Use the argparse choices behavior as a reference; done means accepted values are restricted to the supplied choices and those choices appear in generated help text.

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

Descrição

enhancement

Summary

Add choices parameter to argument and option functions to accept list of allowed values for an argument or an option. Reject any values that do not match the provided list.

Enhancement's value
  • This would allow developers to specify a limited set of choices and automatically validate the input against that list.
  • It will be rendered in the documentation generated via --help, help and, thus, automatically explain to user what values are accepted for this option/argument – huge help for users.
Notes

Maybe take the same approach that works in argparse?

Linguagem predominante
Python
Estrelas
1.4k
Forks
104
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de python-poetry/cleo

Todas as issues de python-poetry/cleo

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

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