bcicen / slackcat

CLI utility to post files and command output to slack
http://slackcat.chat
MIT License
1.22k stars 57 forks source link

exit code should be non-zero on incorrect arguments #45

Closed aerickson closed 7 years ago

aerickson commented 7 years ago

I'd expect a non-zero exit code if the arguments provided were incorrect.

redacted@redacted-B-MBP:~/git/infrastructure/ansible (ap_in_env_improvements│✚1Δ1)> echo 'test123' | slackcat -s -c staging-feed -p
Incorrect Usage. flag provided but not defined: -p

NAME:
   slackcat - redirect a file to slack

USAGE:
   slackcat [global options] command [command options] [arguments...]

VERSION:
   1.2.1

COMMANDS:
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --channel value, -c value   Slack channel or group to post to
   --comment value             Initial comment for snippet
   --configure                 Configure Slackcat via oauth
   --filename value, -n value  Filename for upload. Defaults to current timestamp
   --filetype value            Specify filetype for synax highlighting
   --noop                      Skip posting file to Slack. Useful for testing
   --stream, -s                Stream messages to Slack continuously instead of uploading a single snippet
   --tee, -t                   Print stdin to screen before posting
   --help, -h                  show help
   --version, -v               print the version
redacted@redacted-B-MBP:~/git/infrastructure/ansible (ap_in_env_improvements│✚1Δ1)> echo $?
0
redacted@redacted-B-MBP:~/git/infrastructure/ansible (ap_in_env_improvements│✚1Δ1)>
aerickson commented 7 years ago

Found https://github.com/urfave/cli/issues/610.

bcicen commented 7 years ago

Thanks for the details @aerickson. This is resolved in https://github.com/vektorlab/slackcat/commit/5add3e434b990f33931ecc5bfccc38ef0ace08a7 and will be included in the next release.

bcicen commented 7 years ago

Included in the latest release