api-platform-tools icon indicating copy to clipboard operation
api-platform-tools copied to clipboard

Incorrect error code on exit

Open codebudo opened this issue 12 years ago • 0 comments

When apigeetool -h is run it displays the help messages. Since no errors have occurred and the app behaved correctly, the exit status code should be 0. Unfortunately, it is 2. Help messages for the other valid commands have similar non-zero exit codes.

Using the apigeetool with other tools (e.g. Grunt) that check error status codes produces unwanted results. Grunt tasks stop because it thinks something went wrong.

You can check this with echo:

$ apigeetool -h
Usage: apigeetool <cmd> <options>
Valid commands:
  deployproxy:        Deploy an API proxy from a local directory
  deploynodeapp:      Deploy a NodeJS app from a local directory
  listdeployments:    List deployed APIs or apps
  undeploy:           Undeploy a proxy or app
$ echo $?
2

It's certainly a minor but, but inline documentation is very useful and it would be great to fully support it. Cheers!

codebudo avatar Feb 19 '14 22:02 codebudo