Skip to content

Commit

Permalink
Merge branch 'master' into expired-object-all-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
prakashsvmx authored Feb 12, 2024
2 parents ed939f7 + 669cb0a commit 03c9dfe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
19 changes: 3 additions & 16 deletions cmd/globals.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"context"
"crypto/x509"
"net/url"
"os"
"time"

"github.com/charmbracelet/lipgloss"
Expand Down Expand Up @@ -86,26 +85,14 @@ var (
// Terminal height/width, zero if not found
globalTermWidth, globalTermHeight int

globalDisablePagerFlag = "--disable-pager"
globalPagerDisabled = false
globalHelpPager *termPager
globalPagerEnabledTerms = map[string]bool{
"screen-256color": true,
"xterm": true,
"xterm-256color": true,
"tmux": true,
"tmux-256color": true,
}
globalDisablePagerFlag = "--disable-pager"
globalPagerDisabled = false
globalHelpPager *termPager

// CA root certificates, a nil value means system certs pool will be used
globalRootCAs *x509.CertPool
)

func terminalSupportsPager() (ok bool) {
_, ok = globalPagerEnabledTerms[os.Getenv("TERM")]
return
}

func parsePagerDisableFlag(args []string) {
for _, arg := range args {
if arg == globalDisablePagerFlag {
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ func registerApp(name string) *cli.App {
app.EnableBashCompletion = true
app.OnUsageError = onUsageError

if isTerminal() && terminalSupportsPager() && !globalPagerDisabled {
if isTerminal() && !globalPagerDisabled {
app.HelpWriter = globalHelpPager
} else {
app.HelpWriter = os.Stdout
Expand Down

0 comments on commit 03c9dfe

Please sign in to comment.