release-engineering/kobo

Enhancement: add a --profile option

rhjostone opened this issue · 1 comments

As I understand it, Kobo supports loading configuration values from a file:

def load_from_file(self, file_name):

And the extent of runtime configuration for a (global) profile is generally implemented through environment variables in a downstream client:

3) Define and call main() function

Users would have to write wrapper scripts to ensure the correct profile is set if using this approach.

Could configuration profiles be implemented as a CLI option? The option could look like this:

$ downstream-kobo-client --help
Usage: downstream-kobo-client <command> [args] [--help]

Options:
  -h, --help           show this help message and exit
  --username=USERNAME  specify user
  --password=PASSWORD  specify password
  --profile=PROFILE    specify profile

Which could run like this:

$ downstream-kobo-client --profile=${PROFILE}

And this in turn could look in a designated configuration folder like so:

/etc/downstream-kobo-client/${PROFILE}.conf

Released in kobo 0.18.0.