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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user