Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #30747 - Make fuzzy search work in hammer shell #335

Merged
merged 1 commit into from
Sep 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions lib/hammer_cli/help/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,6 @@ def heading(label)
label = HighLine.color(label, :bold) if @richtext
puts label
end

private

def expand_invocation_path(path)
bits = path.split(' ')
parent_command = HammerCLI::MainCommand
new_path = (bits[1..-1] || []).each_with_object([]) do |bit, names|
subcommand = parent_command.find_subcommand(bit)
next if subcommand.nil?

names << if subcommand.names.size > 1
"<#{subcommand.names.join('|')}>"
else
subcommand.names.first
end
parent_command = subcommand.subcommand_class
end
new_path.unshift(bits.first).join(' ')
end
end
end
end
2 changes: 1 addition & 1 deletion lib/hammer_cli/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def self.expand_invocation_path(path)
bits = path.split(' ')
parent_command = HammerCLI::MainCommand
new_path = (bits[1..-1] || []).each_with_object([]) do |bit, names|
subcommand = parent_command.find_subcommand(bit)
subcommand = parent_command.find_subcommand(bit, fuzzy: false)
next if subcommand.nil?

names << if subcommand.names.size > 1
Expand Down