Skip to content

Commit

Permalink
Add debris to try solve issue when setting PAGER=less (dbuenzli#167).
Browse files Browse the repository at this point in the history
  • Loading branch information
dbuenzli authored and rgrinberg committed Apr 4, 2023
1 parent c7f97d0 commit 15e0d59
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cmdliner_manpage.ml
Original file line number Diff line number Diff line change
Expand Up @@ -446,16 +446,15 @@ let find_cmd cmds =

let pp_to_pager print ppf v =
let pager =
let cmds = ["less"," -R"; "more", ""] in
(* Fundamentally env var lookups should try to cut the exec name. *)
let cmds = ["less", ""; "more", ""] in
let cmds = try (Sys.getenv "PAGER", "") :: cmds with Not_found -> cmds in
let cmds = try (Sys.getenv "MANPAGER", "") :: cmds with Not_found -> cmds in
find_cmd cmds
in
match pager with
| None -> print `Plain ppf v
| Some (pager, opts) ->
let pager = pager ^ opts in
let pager = "LESS=FRX " ^ pager ^ opts in
let groffer =
let cmds =
["mandoc", " -m man -K utf-8 -T utf8";
Expand Down

0 comments on commit 15e0d59

Please sign in to comment.