mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 08:14:18 +02:00
add external pager support via ES_JSON_PAGER (#65)
This commit is contained in:
@@ -106,6 +106,8 @@ type Config struct {
|
||||
|
||||
FromNode, ToNode string // cluster reroute move: -f + -t
|
||||
AllowPrimary, AcceptDataLoss bool // cluster reroute cancel: -p,-a
|
||||
|
||||
Pager string // api repl: -p || PAGER
|
||||
}
|
||||
|
||||
func NewConfig() *Config {
|
||||
|
||||
@@ -36,3 +36,14 @@ func GetTermWidth() int {
|
||||
|
||||
return 80
|
||||
}
|
||||
|
||||
func GetTermHeight() int {
|
||||
if term.IsTerminal(int(os.Stdout.Fd())) {
|
||||
_, height, err := term.GetSize(int(os.Stdout.Fd()))
|
||||
if err == nil {
|
||||
return height
|
||||
}
|
||||
}
|
||||
|
||||
return 25
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user