fix(cli): tweak required argument names and styles + validate CLI documentation drift - #45
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the oapi-codegen CLI flag naming and propagates the new, consistent invocation style across user-facing docs, examples, and the project Makefile, while also aligning the embedded --help examples and a console hint with the renamed flags.
Changes:
- Rename CLI args/flags to
--config-file/--output-fileand update the positional arg name tospec_file. - Update all documented CLI examples (README, docs, Makefile, example README,
--helpexamples) to use “options first, spec file last”. - Adjust the “no output destination” console hint to reference
--output-file.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates Quickstart and design-differences bullet to use --config-file / --output-file. |
| Makefile | Updates generate-example commands to the new flag names and consistent argument ordering. |
| examples/bookstore/README.md | Adds a dedicated example README documenting the regenerated commands with the new flags. |
| docs/design.md | Updates the design doc’s “explicit invocation” section to the new flag names. |
| docs/configuration.md | Updates CLI synopsis and flag descriptions to the new names (one placeholder inconsistency noted). |
| crates/oapi-codegen/src/main.rs | Renames CLI struct fields/flags and updates the embedded --help examples accordingly. |
| crates/oapi-codegen/src/console.rs | Updates the “no output destination” hint to reference --output-file. |
| .github/copilot-instructions.md | Adds a pinned guideline documenting the “options first, spec last” CLI example convention. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
docs/configuration.md:6
- The CLI synopsis placeholder uses
<spec.yaml>but the argument description below uses<spec-file>. Using one placeholder consistently makes it clearer that this is a positional argument name rather than a literal filename.
oapi-codegen --config-file <cfg.yaml> [--output-file <out.rs>] <spec.yaml>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
crates/oapi-codegen/tests/example_commands.rs:170
- The temporary workspace directory is only removed at the end of the loop body. If any documented command fails (assert/panic), the test will unwind before the explicit
remove_dir_all, leaving the copied workspace behind in the OS temp dir and potentially accumulating over time in CI.
let workspace = std::env::temp_dir().join(format!("oapi-codegen-docs-{}-{offset}", std::process::id()));
copy_dir(&example.dir, &workspace);
2a315ea to
c85d6ff
Compare
c85d6ff to
2b5e0d2
Compare
2b5e0d2 to
5fcfd4e
Compare
|
🎉 This PR is included in version 1.0.0-dev.6 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
No description provided.