Proposition: `-c` should use a single argument
Changes
Scripts passed inline to -c
should be in one single argument. ex:
ion -c echo hello world
should be
ion -c 'echo hello world'
Extra parameters should be passed as @args
Pros:
- No need to interpret user meaning, thus making the tool more obvious. ex: What should
ion -c echo hello '@args[1]'
print? Most would expect the literal '@args[1]', not its expansion. - Most if not all *nix CLI tools expect a single parameter after a short option
- Streamlines the API as positional parameters are always used in the same manner
- Use the standard (sh-like) -c format
Cons:
- Breaking change. But as it is in alpha stage right now, it is the perfect moment IMO.
Wanna be cons:
- Useless nested quoting. But because arguments are stripped of their quotes, one also needs nested quoting in the current manner of things, simply in a more local way. ex:
ion -c echo "'"'Not expanded $(Hello World)'"'"
vs
ion -c "echo '"'Not expanded $(Hello World)'"'"