getsops / getsops/sops

`--output-type` must appear before `-d`

Open
#1,259 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
23.1k
Forks
1.1k
Avg merge
1d 11h
Merged PRs (30d)
9

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the command-order difference using an encrypted .env file, comparing sops -d secrets.enc.env --output-type json with sops --output-type json -d secrets.enc.env; also inspect the behavior described by sops --help for global options. Done means the documented global options work regardless of their position, or the ordering requirement is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.