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
|
||||
end
|
||||
end
|
||||
|
||||
def help; description; end
|
||||
end
|
||||
|
||||
# A super-class ofr Commands with structure.
|
||||
|
@ -232,6 +234,11 @@ class Pry
|
|||
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.
|
||||
def slop
|
||||
Slop.new do |opt|
|
||||
|
|
|
@ -286,7 +286,7 @@ class Pry
|
|||
stagger_output(help_text)
|
||||
else
|
||||
if command = find_command(cmd)
|
||||
output.puts command.description
|
||||
output.puts command.new.help
|
||||
else
|
||||
output.puts "No info for command: #{cmd}"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue