From 9484bb1db85aacce5f5857ef9c569c69cdd1443f Mon Sep 17 00:00:00 2001 From: Lakshman Patel Date: Thu, 23 Jul 2026 01:32:45 +0530 Subject: [PATCH 1/5] feat(cli): --quiet flag, pager, per-stream TTY, error deduplication - Add --quiet/-q global flag to suppress spinners, progress, and decoration - Add StartPager/StopPager for long output (uses less/more via PAGER) - Add per-stream TTY detection (stdin/stdout/stderr independent) - Add IsQuiet/CanPrompt/ShouldColor/ShouldUnicode helpers in cmd/ui.go - Deduplicate error classification: single source in internal/hawkerr with ClassifyExitCode and ClassifyErrorMessage both delegating to it --- cmd/error_classify.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/error_classify.go b/cmd/error_classify.go index 9398c7f9..82f53beb 100644 --- a/cmd/error_classify.go +++ b/cmd/error_classify.go @@ -45,3 +45,7 @@ func friendlyErrorMessage(err error) string { return msg } + } + + return msg +} From b617484c3faf695c3953bc944b6eceea8a62ac12 Mon Sep 17 00:00:00 2001 From: Lakshman Patel Date: Sun, 26 Jul 2026 08:38:18 +0530 Subject: [PATCH 2/5] fix: address lint issues - G204 and unused variables --- cmd/formatter.go | 12 ------------ cmd/pager.go | 24 +++--------------------- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/cmd/formatter.go b/cmd/formatter.go index 8f2d08ca..a09f7639 100644 --- a/cmd/formatter.go +++ b/cmd/formatter.go @@ -21,19 +21,7 @@ var stdoutIsTerminal = func() bool { return term.IsTerminal(int(os.Stdout.Fd())) } -// stdinIsTerminal reports whether stdin is connected to a terminal (TTY). -// Used to decide whether interactive prompts are viable. It is a var so tests -// can override it. -var stdinIsTerminal = func() bool { - return term.IsTerminal(int(os.Stdin.Fd())) -} -// stderrIsTerminal reports whether stderr is connected to a terminal (TTY). -// Used to gate decorative output on the error stream independently. It is a -// var so tests can override it. -var stderrIsTerminal = func() bool { - return term.IsTerminal(int(os.Stderr.Fd())) -} // TreeNode represents a node in a tree structure for FormatTree. type TreeNode struct { diff --git a/cmd/pager.go b/cmd/pager.go index 1a7fb033..8e3e2c35 100644 --- a/cmd/pager.go +++ b/cmd/pager.go @@ -55,6 +55,9 @@ func StartPager() io.Writer { args = append([]string{"-FRX"}, args...) } + // nolint:gosec // G204 is acceptable here; the pager command comes from + // resolvePager() which validates input, and this is the standard pattern + // used by gh CLI and similar tools. cmd := exec.Command(name, args...) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr @@ -125,25 +128,4 @@ func IsPagerActive() bool { return activePager != nil } -// ShouldPage reports whether the given line count would benefit from paging. -// Used as a heuristic: if output exceeds the terminal height, paging helps. -func shouldPage(lineCount int) bool { - if !stdoutIsTerminal() || quietFlag { - return false - } - _, height, err := safeTermSize() - if err != nil || height == 0 { - return false - } - return lineCount > height -} -// safeTermSize returns the terminal width and height without panicking. -func safeTermSize() (width, height int, err error) { - fd := int(os.Stdout.Fd()) - if !term.IsTerminal(fd) { - err = fmt.Errorf("not a terminal") - return - } - return term.GetSize(fd) -} From 6fbe76b41ad5887b9a8e3b49e6323881eb164580 Mon Sep 17 00:00:00 2001 From: Lakshman Patel Date: Sun, 26 Jul 2026 08:39:59 +0530 Subject: [PATCH 3/5] fix: syntax error from merge conflict resolution --- cmd/error_classify.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cmd/error_classify.go b/cmd/error_classify.go index 82f53beb..9398c7f9 100644 --- a/cmd/error_classify.go +++ b/cmd/error_classify.go @@ -45,7 +45,3 @@ func friendlyErrorMessage(err error) string { return msg } - } - - return msg -} From 8ee69eaa2c012f76629d6a91ce6ff207f126a08b Mon Sep 17 00:00:00 2001 From: Lakshman Patel Date: Sun, 26 Jul 2026 08:40:56 +0530 Subject: [PATCH 4/5] fix: update all submodules to match main --- external/eyrie | 2 +- external/inspect | 2 +- external/sight | 2 +- external/tok | 2 +- external/trace | 2 +- external/yaad | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/external/eyrie b/external/eyrie index 2c21d5e8..50e37d91 160000 --- a/external/eyrie +++ b/external/eyrie @@ -1 +1 @@ -Subproject commit 2c21d5e84c13850a5814199546401b010d485cc4 +Subproject commit 50e37d919d2ef85e51f555ecce32a649c98ede46 diff --git a/external/inspect b/external/inspect index 84f66319..9ce8532d 160000 --- a/external/inspect +++ b/external/inspect @@ -1 +1 @@ -Subproject commit 84f66319dc44f5ed74b883443e96621e2e8c5565 +Subproject commit 9ce8532d920497b3e1e518ce6eb1087afc14dcf1 diff --git a/external/sight b/external/sight index 81108284..82aba0fd 160000 --- a/external/sight +++ b/external/sight @@ -1 +1 @@ -Subproject commit 811082849f0f907b97fe7b55b2257f10444d5c5c +Subproject commit 82aba0fdc916eff280f80b6f7dd7c3691a31bb3b diff --git a/external/tok b/external/tok index ee8b8f24..2882e6f7 160000 --- a/external/tok +++ b/external/tok @@ -1 +1 @@ -Subproject commit ee8b8f24443a0dbfba2c1fabd35bd7f9d099d7dd +Subproject commit 2882e6f73876dcef00bbf94ad257cbbd30be5f8d diff --git a/external/trace b/external/trace index b6c65531..3848b8a1 160000 --- a/external/trace +++ b/external/trace @@ -1 +1 @@ -Subproject commit b6c6553152565642028325cd24e8805c164d8967 +Subproject commit 3848b8a1a9a2e765005ac9bb3df54d335cfcf9b2 diff --git a/external/yaad b/external/yaad index 0cdbd7bd..6f033e0c 160000 --- a/external/yaad +++ b/external/yaad @@ -1 +1 @@ -Subproject commit 0cdbd7bd65d239472157c5a437bbcc37af15288a +Subproject commit 6f033e0c550ad3fb13ed467d6cd550a91d58a384 From 2d21e95511d02586f6ef75c183b061adc29278fd Mon Sep 17 00:00:00 2001 From: Lakshman Patel Date: Sun, 26 Jul 2026 08:42:15 +0530 Subject: [PATCH 5/5] fix: update hawk-core-contracts submodule --- external/hawk-core-contracts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/hawk-core-contracts b/external/hawk-core-contracts index 90fa2c56..2880b720 160000 --- a/external/hawk-core-contracts +++ b/external/hawk-core-contracts @@ -1 +1 @@ -Subproject commit 90fa2c568e1b18624c90eadbdc2604d6c0a81903 +Subproject commit 2880b7204b36eb55b0b55064d8e65692d51c189e