$ cli this is a message
[ "this", "is", "a", "message" ]
this is a message
$ cli "this is a message"
[ "this is a message" ]
this is a message
In other words, allow the final argument of a command to be marked as variadic without the spread operator. This would make things a little more ergonomic when working with commands where you're input sentences/longer strings - you could do either.
Actual
Currently, the behavior is of course available, but we need to use the spread operator convention.
The issue with this convention is that [...arg] seems to be imply that the arguments are separate conceptual units.
cli
Usage:
$ cli <command> [options]
Commands:
echo [...arg] echo the input back
For more info, run any command with the `--help` flag:
$ sample-cli echo --help
This is not the case when we're entering single sentences, where a set of strings is separated by spaces. It's nice to just be able to do $ cli echo this is a sentence that I want to type unquoted.
Issue Type
Expected
I'd like to be able to do the following:
In other words, allow the final argument of a command to be marked as variadic without the spread operator. This would make things a little more ergonomic when working with commands where you're input sentences/longer strings - you could do either.
Actual
Currently, the behavior is of course available, but we need to use the spread operator convention.
The issue with this convention is that
[...arg]
seems to be imply that the arguments are separate conceptual units.This is not the case when we're entering single sentences, where a set of strings is separated by spaces. It's nice to just be able to do
$ cli echo this is a sentence that I want to type unquoted
.