Conversation
There was a problem hiding this comment.
I still have some misgivings about env as an output format, given output is a global config option/flag, and env is not universally valid.
I think maybe we should consider:
- Not allowing
envviatiger config set output, since that would break some commands, and I don't think it's likely that users would want to configure the env format globally anyways. - Getting rid of the global
--outputflag and replacing it with per-command--outputflags. That way, they could support different options and it wouldn't feel as weird (honestly, it's kind of weird that it's a global flag anyways, since not all commands support it). - For commands that support the
--outputflag, still falling back to the global config option (the value set viatiger config set output) if not otherwise specified.
Otherwise, I think this largely makes sense. Though I also think maybe we should add support to tiger db connection-string (or a new command, if connection-string feels too weird?) for outputting these env vars, so users can do it later too (not just when initially creating a service).
Left a handful of other mostly-minor comments below.
|
Yeah, I'd be happy to get rid of the global
It works with
|
|
this is awesome! |
nathanjcochran
left a comment
There was a problem hiding this comment.
I think this is looking great. Major improvement overall 👍.
I did see one thing that I think is a bug, which we should probably fix. The other comments are mostly minor things that would be nice to fix, but could also be improved later.
nathanjcochran
left a comment
There was a problem hiding this comment.
LGTM! Thanks for tackling this!

This adds support for
envas an output format. It is only supported on individual service outputs, and other usages will fail with an error.The output uses the standard
PG*environment variable names, to increase the liklihood of being directly usable in.envfiles.Like the other output formats, this only controls what is written to
stdout. The user is then able to redirect to a file, if so desired.tiger svc create --free -o env --with-password >> .envAs part of this, I removed the global
--outputflag, and instead implemented individual flags on the commands that use it. This allowed for more clarity and accuracy in validation around the presence of theenvvalue.I also noticed that the
tiger config showcommand had a bug in that it was affected by any CLI args (or env vars) passed to it. We really want this to reflect the config in the file (and defaults if unset). I overhauled how this works, and also added options for--no-defaultsand--with-envto control the behavior a bit.