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

var:create prompts for environment when -e option is present #1002

Open
royallthefourth opened this issue Nov 5, 2020 · 4 comments
Open

Comments

@royallthefourth
Copy link

When creating a new env var with the -e option, I expect that environment to be used. Instead, the CLI tool prompts interactively. A command like this one should contain all the information needed to create an environment variable without prompts: platform var:create -l environment -e master --json=false --sensitive=false --enabled=true --inheritable=false -p PROJECT --value=VALUE VAR_NAME

@pjcdawkins
Copy link
Collaborator

I've looked into this and it's sort of deliberate. The -e master ends up being the default for the environment prompt. In interactive mode a prompt is still displayed. In non-interactive mode (-y) then defaults will be chosen and no prompts shown.

So there's an easy way to avoid prompts - use -y. But I see the behavior clashes a bit with the expectation in most commands, that -e has the highest priority for choosing the environment.

@drjayvee
Copy link

One problem with the -y workaround is that it applies to all options (e.g., --json, --visible-runtime, etc).

If I use -y to "enforce" -e production (we don't use "master" at all) and forget one of the other switches, the CLI will use its default when I'd rather get a prompt.

@pjcdawkins
Copy link
Collaborator

@royallthefourth @drjayvee thanks for your feedback over the last 2 years :) You may be interested in the two PRs:

@pjcdawkins
Copy link
Collaborator

For some more clarification: -y does not apply to --json/--visible-runtime, etc., those are true or false value questions not confirmation questions (see #1054 and 42472e8/platformsh/console-form@f3466e2)

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

3 participants