api: Add support for Environment Variables.

This adds support for controlling the basic configuration (user, API
key, etc.) of the Zulip API bindings via environment variables.

Fixes #3364.

Tweaked by tabbott to update variable names and document in README.md.
This commit is contained in:
Rohitt Vashishtha 2017-01-27 03:30:29 +05:30 committed by Tim Abbott
parent 46e7e05516
commit 863df67150
2 changed files with 23 additions and 1 deletions

View file

@ -44,7 +44,12 @@ Alternatively, you may explicitly use "--user", "--api-key", and
`--site` in our examples, which is especially useful when testing. If
you are running several bots which share a home directory, we
recommend using `--config` to specify the path to the `zuliprc` file
for a specific bot.
for a specific bot. Finally, you can control the defaults for all of
these variables using the environment variables `ZULIP_CONFIG`,
`ZULIP_API_KEY`, `ZULIP_EMAIL`, `ZULIP_SITE`, `ZULIP_CERT`,
`ZULIP_CERT_KEY`, and `ZULIP_CERT_BUNDLE`. Command-line options take
precedence over environment variables take precedence over the config
files.
The command line equivalents for other configuration options are: