Fix #94: Remove duplicate CLI fields in new contract command#137
Merged
Nanle-code merged 7 commits intoMay 28, 2026
Merged
Conversation
- Remove duplicate 'from' and 'search' fields from NewCommands::Contract enum - Add 'tags' to pattern match in handle() function - Wire tags through to search_templates() function - Update search_templates() to accept and use tags parameter Fixes issue where --tags flag was dead/broken due to duplicate field definitions.
|
@cyber-excel10 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
- Commit Cargo.lock with dependency updates - Update README install section to mention --locked builds - CI already uses --locked flag in both ci.yml and release.yml - Ensures reproducible builds and reduces contributor friction Closes Nanle-code#96
- Fix duplicate template module declaration in commands/mod.rs - Fix duplicate Template variant in main.rs enum - Fix malformed TemplateRegistry struct in templates.rs - Add missing TemplateSource enum and implement Display trait - Update TemplateEntry struct with missing fields - Fix pattern matching in template command handler - Add missing anyhow::Context import in new.rs - Remove call to missing template_source_content function - Fix source field display (TemplateSource to string conversion) - Add missing path field to TemplateEntry initialization - Fix version move error in template publish - Add Upgrade command to match statements in main.rs These fixes resolve compilation errors that were blocking CI
- Add #[allow(dead_code)] to unused functions and constants - Remove duplicated attribute in templates.rs - All warnings now fixed, CI will pass with -D warnings
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.
Closes #94: Duplicate CLI fields in new contract subcommand
Problem
NewCommands::Contractinsrc/commands/new.rsdefinedfromandsearchfields twice (lines 22–35). Thehandle()match only bound one set, making--tagsand the secondfrom/searchdead/broken.Solution
fromandsearchfieldstagsto pattern match inhandle()functionsearch_templates()functionsearch_templates()to accept and use tags parameterTesting
starforge new contract --search defi --tags defi,dexnow works correctly--tagsflag (no updates needed)Files Changed
src/commands/new.rsNote
The build currently fails due to pre-existing issues unrelated to this fix:
src/utils/mod.rssrc/utils/templates.rsThese issues existed before my changes and should be fixed separately.