driver: an unknown --opt= goal should name the valid goals
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 83/100
Línea de trabajo
Lee el manejo de --pass=/--no-pass= cerca de la línea 8580 en src/driver/main.c y las entradas de --opt= en src/driver/options.def (líneas 114–121). Añade cobertura en tests/golden/options-table.sh o tests/golden/gcc-flags.sh y comprueba que un objetivo no válido enumera los objetivos válidos y omite el texto de uso. Se considera terminado cuando el mensaje se genera a partir de la tabla de opciones y pasan las pruebas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Context. --opt= takes a goal (none, basic, debug, speed, max, size, min-size). A wrong one gets a generic error and the whole usage text:
$ ./embcc --opt=sped -c t.c
embcc: error: unknown argument '--opt=sped'
usage: embcc [-c|-S|-E] SOURCE... [-o FILE] ...
--pass= already does better: embcc: error: --pass=X: no optimizer pass has that name; the passes are a, b and c. --opt= should do the same, and suggest the closest goal.
Where.
src/driver/main.c, around line 8580: the--pass=/--no-pass=branch, which is the pattern to follow. The genericunknown argumenterror comes right after it.src/driver/options.def, lines 114–121: the--opt=goals are entries in the option table, so the list does not need typing in again.- Tests:
tests/golden/options-table.shandtests/golden/gcc-flags.shalready check option errors.
Steps.
- When
opt_typed(argv[i])starts with--opt=and matched no entry, printembcc: error: --opt=sped: not a goal; the goals are none, basic, debug, speed, max, size and min-size. Build the list from the option table. - Optionally, add
did you mean --opt=speed?when one goal is close. - Add a test that checks the message, and that the usage text is no longer printed.
Done when an unknown --opt= names the valid goals, the list comes from options.def (adding a goal there updates the message), and the tests pass.
Before you start: the contributor's guide has the rules. A new test counts only after it has failed against the code before your change, and a commit subject reads area: summary. Questions are welcome in the comments or in Discussions.
- Lenguaje dominante
- C
- Estrellas
- 1
- Forks
- 2
- Merge medio
- 20 h 55 min
- PR fusionados (30 d)
- 73
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de EmbLinkOs/EmbCC
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 50/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
Todos los issues de EmbLinkOs/EmbCC
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
area: test kind: bug preview-effort: small priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
libsdl-org/SDL#16684 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Issue-Bug Needs-Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días