Answer product-owner round 1: the hint for an empty stdin points to --list, the help's examples are templates only, the README's record id is an integer, and a test over an indexed module renders each path

This commit is contained in:
2026-10-11 23:29:23 +02:00
committed by Lillem4n
parent 00257e2851
commit 5e6330c75b
2 changed files with 4 additions and 4 deletions
+1 -2
View File
@@ -29,7 +29,6 @@ COMMAND reads one template from stdin and renders it:
echo 'id: {int(1,999)}' | COMMAND
echo '{"format":"{x}","x":["bosse","lina"]}' | COMMAND
COMMAND --list # the paths a {/path} reference reads
COMMAND < template.txt
COMMAND <<'EOF'
@@ -630,7 +629,7 @@ func run(name string, modules []fs.FS, args []string, stdin io.Reader, stdout, s
func readStdin(stdin io.Reader, name string) (input, error) {
if stdin == nil {
return input{}, inputError{fmt.Errorf("the template comes from stdin, and nothing is piped in: %s", pipeHint(name))}
return input{}, inputError{fmt.Errorf("the template comes from stdin, and nothing is piped in: %s; %s --list prints the paths a {/path} reference reads", pipeHint(name), name)}
}
raw, err := io.ReadAll(stdin)
if err != nil {