refactor: validate required command arguments before running - #943
Merged
Conversation
…d split - Parse each command's args and the `--config` overlay into a `*Raw` type with `Option` required fields, then convert to a validated type through `TryFrom` that enforces presence, so run code reads required inputs without the `.expect` crash-guards - Build the missing-argument error from the command's clap metadata so renaming a flag cannot desync the message, with a clap-default fallback for non-clap builds such as the Node bindings - Pin the merge round-trip invariant per command so an asymmetric serializer or a nested struct missing `#[serde(default)]` fails a test rather than corrupting a config load
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
*Rawtype and a validated type joined by aTryFromthat enforces required-input presence [src].expectcrash-guards from the required-input accessors, returning the proven-present values directly [src]overlay_config[src]