Class: Ace::Search::CLI::Commands::Search
- Inherits:
-
Ace::Support::Cli::Command
- Object
- Ace::Support::Cli::Command
- Ace::Search::CLI::Commands::Search
- Includes:
- Ace::Support::Cli::Base
- Defined in:
- lib/ace/search/cli/commands/search.rb
Overview
ace-support-cli Command class for the search command
This command handles all search functionality including file and content search across the codebase with intelligent pattern matching.
Note: CLI orchestration methods (execute_search_command, resolve_search_path) are intentionally in this class as they handle CLI-specific concerns (config display, error messages, interactive selection). Business logic is properly delegated to ATOM layers (UnifiedSearcher, SearchPathResolver).
Instance Method Summary collapse
Instance Method Details
#call(**options) ⇒ Object
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/ace/search/cli/commands/search.rb', line 102 def call(**) # Extract pattern and search path @pattern = [:pattern] @search_path = [:search_path] # Remove ace-support-cli specific keys (args is leftover arguments) = .reject { |k, _| k == :args } if [:version] puts "ace-search #{Ace::Search::VERSION}" return 0 end # Type-convert numeric options using Base helper for proper validation # coerce_types uses Integer() which raises ArgumentError on invalid input # (unlike .to_i which silently returns 0) coerce_types(, max_results: :integer, context: :integer, after_context: :integer, before_context: :integer) # Build search options from CLI options using dedicated molecule @options = Ace::Search::Molecules::SearchOptionBuilder.new().build # Execute search execute_search_command end |