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

fix: ignore --pretty when --output is used for oras manifest fetch #1363

Merged
merged 2 commits into from
Apr 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cmd/oras/root/manifest/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@
switch {
case opts.outputPath == "-" && opts.Template != "":
return fmt.Errorf("`--output -` cannot be used with `--format %s` at the same time", opts.Template)
case opts.OutputDescriptor && opts.outputPath == "-":
case opts.outputPath == "-" && opts.OutputDescriptor:
return fmt.Errorf("`--descriptor` cannot be used with `--output -` at the same time")
case opts.outputPath != "" && opts.Pretty.Pretty:
wangxiaoxuan273 marked this conversation as resolved.
Show resolved Hide resolved
opts.Pretty.Pretty = false

Check warning on line 80 in cmd/oras/root/manifest/fetch.go

View check run for this annotation

Codecov / codecov/patch

cmd/oras/root/manifest/fetch.go#L79-L80

Added lines #L79 - L80 were not covered by tests
}
if err := oerrors.CheckMutuallyExclusiveFlags(cmd.Flags(), "format", "pretty"); err != nil {
return err
Expand Down
Loading