From e31136a6770b86857582e214edf25403e83c28a5 Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Tue, 23 Sep 2025 15:42:25 +0100 Subject: [PATCH] docs(auth status): explain `--json` will always exit with zero Signed-off-by: Babak K. Shandiz --- pkg/cmd/auth/status/status.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/auth/status/status.go b/pkg/cmd/auth/status/status.go index 9869d9c79..348b9531d 100644 --- a/pkg/cmd/auth/status/status.go +++ b/pkg/cmd/auth/status/status.go @@ -141,8 +141,10 @@ func NewCmdStatus(f *cmdutil.Factory, runF func(*StatusOptions) error) *cobra.Co For each host, the authentication state of each known account is tested and any issues are included in the output. Each host section will indicate the active account, which will be used when targeting that host. + If an account on any host (or only the one given via %[1]s--hostname%[1]s) has authentication issues, - the command will exit with 1 and output to stderr. + the command will exit with 1 and output to stderr. Note that when using the %[1]s--json%[1]s option, the command + will always exit with zero regardless of any authentication issues, unless there is a fatal error. To change the active account for a host, see %[1]sgh auth switch%[1]s. `, "`"),