Answer architecture round 3 and principles audits round 2: a weight drawn against nothing names the drop, null alone on stdin names jq, the CLI-copy decision names hasEmptySegment, the padding and layout decisions quote what they catch, and the padded binding is filed

This commit is contained in:
2026-10-07 23:25:14 +02:00
committed by Lillem4n
parent c8193da3d0
commit 57bd06c16f
4 changed files with 21 additions and 12 deletions
+4 -1
View File
@@ -459,6 +459,9 @@ func parseInput(raw string) (input, error) {
if trimmed == "" {
return input{}, fmt.Errorf("stdin holds no template: %s", pipeHint)
}
if trimmed == "null" {
return input{}, fmt.Errorf("stdin holds only null, as jq prints for a missing key: %s", pipeHint)
}
text := raw
if json.Valid([]byte(trimmed)) {
text = trimmed
@@ -511,7 +514,7 @@ func hasEmptySegment(path string) bool {
switch {
case seg != "":
stepUp = false
case stepUp && !last, !stepUp && last:
case stepUp != last:
return true
default:
stepUp = !stepUp