realestate-com-au / shush

It's a secret.
169 stars 36 forks source link

Arguments to the command after `shush exec` are parsed by shush instead #8

Closed amcinnes closed 7 years ago

amcinnes commented 7 years ago

When I do this:

shush exec ls -la

I get

Incorrect Usage: flag provided but not defined: -la

NAME:
   shush exec - Execute a command

USAGE:
   shush exec [command options] [arguments...]

OPTIONS:
   --prefix value  environment variable prefix (default: "KMS_ENCRYPTED_")

I would expect shush to know that any command-line options passed after the command belong to the command and not to shush itself.

i.e. I would expect shush exec ls -la to do the same as shush exec -- ls -la

mdub commented 7 years ago

I think this is default behaviour - looking for options anywhere in the command-line - of the option-parsing library we use, urfave/cli.

I agree it's surprising, and annoying, for a "command shim" tool like shush. Hopefully there's a way to disable that behaviour. If not, we could switch to ogier/pflag, which I know can be configure to work how we want.

mdub commented 7 years ago

Ironically, my Ruby command-line parsing library, clamp, has an open issue requesting support for the behaviour we don't want here :-)