exit non-zero if option parsing fails
change exit code

Change the exit code to use an unused exit code.
Merge pull request #40 from nnutter/opts

exit non-zero if option parsing fails
fix missed --owner/--based-on mutual exclusivity

--owner and --based-on were made no longer mutually exclusive when we
switched to always creating databases with a template.
allow timeout to be specified when creating a user-agent

I've been unable to run against our dev VM because the request times
out so I would like to be able to override the default.
do not import unused functions
pass timeout through to get_user_agent
allow timeout to be specified for get_*_name_from_id
allow timeout to be specified for foreach_database_or_template
use parse_opts

This commit is to separate out this change from the upcoming addition of
a timeout option.
add timeout option to list commands
add newline to help output
Merge pull request #45 from nnutter/based-on

fix missed --owner/--based-on mutual exclusivity
allow default timeout to be specified by env
Merge pull request #46 from nnutter/timeout

add timeout option to commands
template_id is now a required param for creating databases - there is no default

Caller is responsible for finding a suitable template_id.

This also creates a new config item default_template_name used to name the
template used when creating a new DB and no template was given.
extract method to determine template_id when creating databases
Combine create-related methods into one

This separation was necessary when there were separate codepaths for creating
a blank DB and creating a DB from a template.  Since we now only create from
templates, these can be combined.
Don't create a DB with template1 using template1's owner

template1 will likely be owned by the postgres superuser, which should
be a different user then the one the app connects to the DB as.  It
won't have permission to use GRANT to give this user permissions from
the postgres superuser.

Note that they'll still fail if the user specificly requests 'owner'
to be the postgres superuser
Add a config item external_hostname

This is the reported DB hostname when listing database entities through
the REST interface.

This way, db_host can be set to localhost, and it can report the created
database's host as something reachable from the network