Prevent API request if authkey is not set and print error if API host is not set.

The authentication key may be derived from a saved property file or from the command line as an optional argument to override the property file.
But if the property file does not exist, and the command line override is not set, then the API request is made and fails with "authentication
required".

This commit factors all the authenticated commands so that there is a single point where the authentication argument is added to a command or sub-command.
It is more convenient then to make the auth key a required positional argument. This is not done at this point however as it will require some changes to the
unit tests.

This commit also includes a fix for issue #29. If default.props does not exist because CLI was not built, then CLI should still be usable if user provides an API host override. Hence, allow for missing default properties file but raise an error if trying to do any operation against the API.
11 files changed
tree: b7352758b34fae20170788a94a84b6aa74663413
  1. tools/