Skip to content

Commit

Permalink
fix: remove unwanted newline in attach error (#1265)
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah authored Feb 1, 2024
1 parent f466e89 commit b4fb6b0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cmd/oras/root/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,9 @@ func runAttach(cmd *cobra.Command, opts *attachOptions) error {
}
if len(opts.FileRefs) == 0 && len(annotations[option.AnnotationManifest]) == 0 {
return &oerrors.Error{
Err: errors.New(`neither file nor annotation provided in the command`),
Usage: fmt.Sprintf("%s %s", cmd.Parent().CommandPath(), cmd.Use),
Recommendation: `To attach to an existing artifact, please provide files
via argument or annotations via flag "--annotation". Run "oras attach -h"
for more options and examples`,
Err: errors.New(`neither file nor annotation provided in the command`),
Usage: fmt.Sprintf("%s %s", cmd.Parent().CommandPath(), cmd.Use),
Recommendation: `To attach to an existing artifact, please provide files via argument or annotations via flag "--annotation". Run "oras attach -h" for more options and examples`,
}
}

Expand Down

0 comments on commit b4fb6b0

Please sign in to comment.