mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Add a space when completing command names and long options
This commit is contained in:
parent
b18a52f9a5
commit
7a5d21ba74
4 changed files with 4 additions and 4 deletions
|
@ -513,7 +513,7 @@ class Pry
|
|||
# @return [Array<String>] the words to complete
|
||||
def complete(search)
|
||||
slop.map do |opt|
|
||||
[opt.long && "--#{opt.long}" || opt.short && "-#{opt.short}"]
|
||||
[opt.long && "--#{opt.long} " || opt.short && "-#{opt.short}"]
|
||||
end.flatten(1).compact + super
|
||||
end
|
||||
|
||||
|
|
|
@ -365,7 +365,7 @@ class Pry
|
|||
else
|
||||
commands.keys.select do |x|
|
||||
String === x && x.start_with?(search)
|
||||
end + Bond::DefaultMission.completions
|
||||
end.map{ |command| command + " " } + Bond::DefaultMission.completions
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -666,7 +666,7 @@ describe "Pry::Command" do
|
|||
end
|
||||
end
|
||||
|
||||
@set.complete('torrid ').should.include('--test')
|
||||
@set.complete('torrid ').should.include('--test ')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -615,7 +615,7 @@ describe Pry::CommandSet do
|
|||
describe '.complete' do
|
||||
it "should list all command names" do
|
||||
@set.create_command('susan'){ }
|
||||
@set.complete('sus').should.include 'susan'
|
||||
@set.complete('sus').should.include 'susan '
|
||||
end
|
||||
|
||||
it "should delegate to commands" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue