Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re config get-token doesn't respect --context parameter #130

Open
jcalero opened this issue Apr 20, 2022 · 2 comments
Open

re config get-token doesn't respect --context parameter #130

jcalero opened this issue Apr 20, 2022 · 2 comments

Comments

@jcalero
Copy link
Member

jcalero commented Apr 20, 2022

Calling re config get-token always returns the default token, regardless of --context or -c flags being passed.

$ re config get-token
[default token]
$ re --context local config get-token
[default token]

Confirmed that the --context parameter works for other commands and that the token is indeed different in the config.json. So it seems only the get-token command fails.

Package version 0.11.0

@mcobzarenco
Copy link
Member

get-token seems to take an argument with the context, so not sure it should?

re conf get-token local-acme

Also, commands under re config ignore --context as they are to do with managing contexts, e.g. re config add --name abc adds a new context abc. Similarly re conf ls lists all contexts, it's not super clear what it should do with --context

@jcalero
Copy link
Member Author

jcalero commented Jun 22, 2022

I guess it's a matter of UX. As a user of re I use it with re --context ... constantly, but then suddenly another command takes the context as a positional argument instead of a flag, it's confusing and inconsistent.

Aside from that, the fact that passing --context to the re config parameter is not met with an error (the argument is just swallowed), is very bad. It means you could be thinking you're doing the right thing with a command like re --context local config get-token but you're actually running the command with the staging context. I literally could be deleting sources and thinking I'm doing it on the local environment but I'm deleting them on staging. That's not good.

And then, finally. I get your point about the re config sub-commend being all about the context, but then again, that's not great UX, why is it called config when it's about context? Pick one term? Otherwise it's not about context, it's about many things including the context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants