1
0

fix exec expression newline handling

This commit is contained in:
Arpad Ryszka 2026-03-15 14:27:45 +01:00
parent 7ed227beb3
commit 4773cde12e
2 changed files with 32 additions and 30 deletions

View File

@ -2,9 +2,10 @@
Generated with https://code.squareroundforest.org/arpio/docreflect Generated with https://code.squareroundforest.org/arpio/docreflect
*/ */
package wand package wand
import "code.squareroundforest.org/arpio/docreflect" import "code.squareroundforest.org/arpio/docreflect"
func init() { func init() {
docreflect.Register("code.squareroundforest.org/arpio/wand/tools", "Package tools provides tools to work with the wand library. The functions in this package serve primarily as\nthe implementation of the wand executable command.\n") docreflect.Register("code.squareroundforest.org/arpio/wand/tools", "Package tools provides tools to work with the wand library. The functions in this package serve primarily as\nthe implementation of the wand executable command.\n")
docreflect.Register("code.squareroundforest.org/arpio/wand/tools.Docreflect", "Docreflect generates documentation from the go docs of a package to be included in the compiled binary and\nto be accessed by the automatic help and documentation generator.\n\nThe packageName parameter specifies the package name for the generated Go code.\n\nThe gopath arguments accept any number of package, package level symbol, or struct field paths. It is\nrecommended to use package paths unless there are special circumstances.\n\nfunc(o, out, packageName, gopaths)") docreflect.Register("code.squareroundforest.org/arpio/wand/tools.Docreflect", "Docreflect generates documentation from the go docs of a package to be included in the compiled binary and\nto be accessed by the automatic help and documentation generator.\n\nThe packageName parameter specifies the package name for the generated Go code.\n\nThe gopath arguments accept any number of package, package level symbol, or struct field paths. It is\nrecommended to use package paths unless there are special circumstances.\n\nfunc(o, out, packageName, gopaths)")

View File

@ -188,6 +188,7 @@ func printGoFile(fn string, expression string, imports []string) error {
func execWand(o ExecOptions, stdin io.Reader, stdout, stderr io.Writer, args []string) error { func execWand(o ExecOptions, stdin io.Reader, stdout, stderr io.Writer, args []string) error {
expression, args := args[0], args[1:] expression, args := args[0], args[1:]
expression = strings.TrimSpace(expression)
commandHash, err := hash(expression, o.Import) commandHash, err := hash(expression, o.Import)
if err != nil { if err != nil {
return err return err