vctx: colourise json/yaml output #6
Reference in New Issue
Block a user
Delete Branch "benvin/vctx-colour"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
vctx sets VAULT_FORMAT to yaml/json for reads but execs vault directly, so output is never highlighted the way jq/yq output is.
--color auto|always|never(auto honours TTY, NO_COLOR, TERM=dumb)--colorin docs/vctx.mdoperator unseal,operator generate-root,operator rekey(key prompt via GetWriterFromUI = stdout), andloginMFA passcode (UI.AskSecretwrites to stdout) → exec these too (matchoperator unseal|generate-root|rekeyandlogin), and add them to TestColourFormat.vault write auth/<method>/login/...runs interactive MFA (command/client/write.go:164 → base.ValidateMFA → UI.AskSecret, prompt goes to stdout) when stdin is a TTY; with-format=json|yamlorVAULT_FORMATset the passcode prompt is buffered, so the user sees nothing and vault blocks on stdin → execwritewhen a positional arg starts withauth/(and add a TestColourFormat case).isAuthPathmisses namespace-prefixed login paths (write ns1/auth/userpass/login/bob), so the MFA passcode prompt is buffered and the command hangs silently → match anauth/segment anywhere (e.g.strings.Contains("/"+strings.TrimPrefix(p, "/"), "/auth/")) and add a test case.vault patchshares write's MFA prompt path (handleWriteSecretOutput) → apply the auth-path check topatchtoo.