Replace magic index-to-variant mapping in Select prompts#110
Merged
lukidoescode merged 2 commits intomainfrom Apr 17, 2026
Merged
Replace magic index-to-variant mapping in Select prompts#110lukidoescode merged 2 commits intomainfrom
lukidoescode merged 2 commits intomainfrom
Conversation
- Resolves #96 Introduces strum-annotated CLI-local mirror enums (*SelectionOption) that carry display labels and map to domain types via From impls, eliminating fragile positional index matching. Adds select_variant and select_from_options helpers as the single interface to dialoguer::Select.
- Extract 8 mirror enums into dedicated interaction/selection_options.rs submodule (SRP)
- Replace unwrap_or("") with expect() in select_variant for missing strum annotations
- Add debug_assert! bounds check on default index in select_variant
- Replace From<AdditionalPackageFieldSelectionOption> for Option<AdditionalPackageField>
with an inherent into_field() method; update call site in additional_packages.rs
- Add tests for cli_error_to_operation_error in commands/mod.rs
- Add test for From<dialoguer::Error> for CliError in error.rs
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.
Introduces strum-annotated CLI-local mirror enums (*SelectionOption) that carry display labels and map to domain types via From impls, eliminating fragile positional index matching. Adds select_variant and select_from_options helpers as the single interface to dialoguer::Select.