1
0
Fork 0
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:
Conrad Irwin 2012-11-14 01:52:21 -08:00
parent b18a52f9a5
commit 7a5d21ba74
4 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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