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

--output-type must appear before -d #1259

Open
spencerwilson opened this issue Aug 14, 2023 · 3 comments
Open

--output-type must appear before -d #1259

spencerwilson opened this issue Aug 14, 2023 · 3 comments

Comments

@spencerwilson
Copy link

On sops 3.7.3:

Expected

Given an encrypted .env file,

% sops -d secrets.enc.env --output-type json
<command prints secrets in the env file, but in a JSON object container instead>

Actual

% sops -d secrets.enc.env --output-type json
<command behaves as though `--output-type` was not given

Workaround

Moving --output-type json in front of -d <path> does work:

% sops --output-type json -d secrets.enc.env
<expected output as described above>

Not sure if this is expected behavior and thus a docs gap, or a bug. I'd guess the latter since sops --help says that everything is just a "global option" with no relative order required for them to work.

@felixfontein
Copy link
Contributor

I guess this is related to #598. There's a bunch of similar issues, most (or all?) of them closed linking to that one.

@felixfontein
Copy link
Contributor

Also please note that -d path are two separate options: a flag (-d) and a positional argument (path). All options must come before the positional arguments. So sops -d --output-type json secrets.enc.env will work as well.

@felixfontein
Copy link
Contributor

#1342 improves the situation by at least warning when this happens.

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