Skip to content

Commit

Permalink
Honor --password flag (gopasspw#1822)
Browse files Browse the repository at this point in the history
Do not print the output header when --password/-o is given.

RELEASE_NOTES=[BUGFIX] Fix -o

Fixes gopasspw#1821

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
  • Loading branch information
dominikschulz authored Mar 5, 2021
1 parent b426491 commit 6e6d15b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/action/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (s *Action) showHandleOutput(ctx context.Context, name string, sec gopass.S
}

ctx = out.WithNewline(ctx, ctxutil.IsTerminal(ctx))
if ctxutil.IsTerminal(ctx) {
if ctxutil.IsTerminal(ctx) && !IsPasswordOnly(ctx) {
header := fmt.Sprintf("Secret: %s\n", name)
if HasKey(ctx) {
header += fmt.Sprintf("Key: %s\n", GetKey(ctx))
Expand Down

0 comments on commit 6e6d15b

Please sign in to comment.