mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Make help use Slop where possible
This commit is contained in:
parent
367b353bca
commit
5539f3bebb
2 changed files with 8 additions and 1 deletions
|
@ -197,6 +197,8 @@ class Pry
|
||||||
args.values_at *(0..(arity - 1)).to_a
|
args.values_at *(0..(arity - 1)).to_a
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def help; description; end
|
||||||
end
|
end
|
||||||
|
|
||||||
# A super-class ofr Commands with structure.
|
# A super-class ofr Commands with structure.
|
||||||
|
@ -232,6 +234,11 @@ class Pry
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Return the help generated by Slop for this command.
|
||||||
|
def help
|
||||||
|
slop.help
|
||||||
|
end
|
||||||
|
|
||||||
# Return an instance of Slop that can parse the options that this command accepts.
|
# Return an instance of Slop that can parse the options that this command accepts.
|
||||||
def slop
|
def slop
|
||||||
Slop.new do |opt|
|
Slop.new do |opt|
|
||||||
|
|
|
@ -286,7 +286,7 @@ class Pry
|
||||||
stagger_output(help_text)
|
stagger_output(help_text)
|
||||||
else
|
else
|
||||||
if command = find_command(cmd)
|
if command = find_command(cmd)
|
||||||
output.puts command.description
|
output.puts command.new.help
|
||||||
else
|
else
|
||||||
output.puts "No info for command: #{cmd}"
|
output.puts "No info for command: #{cmd}"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue