mirror of
https://github.com/walles/moar.git
synced 2024-08-16 23:40:35 +03:00
Fix PAGER= setting detection
This commit is contained in:
parent
a77d4f058c
commit
8ad5329a8d
6
moar.go
6
moar.go
@ -41,7 +41,11 @@ func _PrintUsage(output io.Writer) {
|
||||
|
||||
moarPath, err := filepath.Abs(os.Args[0])
|
||||
if err == nil {
|
||||
if os.Getenv("PAGER") != moarPath {
|
||||
pagerValue, err := filepath.Abs(os.Getenv("PAGER"))
|
||||
if err != nil {
|
||||
pagerValue = ""
|
||||
}
|
||||
if pagerValue != moarPath {
|
||||
// We're not the default pager
|
||||
fmt.Fprintln(output)
|
||||
fmt.Fprintln(output, "To make Moar your default pager, put the following line in")
|
||||
|
Loading…
Reference in New Issue
Block a user