Skip to content

Commit

Permalink
Issuer cldwalker#78: allow full path on ENV['PAGER'].
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel E. Doherty committed May 4, 2014
1 parent 069dae9 commit 171c63b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/hirb/pager.rb
Expand Up @@ -8,9 +8,10 @@ def command_pager(output, options={})
end

def pager_command(*commands) #:nodoc:
@pager_command = (!@pager_command.nil? && commands.empty?) ? @pager_command :
@pager_command = (!@pager_command.nil? && commands.empty?) ? @pager_command :
begin
commands = [ENV['PAGER'], 'less', 'more', 'pager'] if commands.empty?
env_pager = ENV['PAGER'] ? File.basename(ENV['PAGER']) : nil
commands = [env_pager, 'less', 'more', 'pager'] if commands.empty?
commands.compact.uniq.find {|e| Util.command_exists?(e[/\w+/]) }
end
end
Expand Down

0 comments on commit 171c63b

Please sign in to comment.