Skip to content

{{.CLI_ARGS}} word-splits args with spaces #125

Description

@notnmeyer
[tasks.run]
cmds = ["go run main.go {{.CLI_ARGS}}"]
➜ tsk run -- -a "oh man!"
   ERROR
  Unknown command "man!" for "daylog".

parseArgs joins the post--- args with a plain space (cmd/tsk/tsk.go:123), then the rendered cmd gets run as shell source (mvdan.cc/sh), so oh man! is re-split into two words. anything with a space (or a shell metachar) breaks.

should shell-quote each arg when joining so {{.CLI_ARGS}} round-trips. workaround for now is nesting quotes: tsk run -- -a "'oh man!'".

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions