From d3ee96d4cad0cadf2daa242167c52de7e324f74f Mon Sep 17 00:00:00 2001 From: Billy Zha Date: Fri, 23 Sep 2022 14:31:20 +0800 Subject: [PATCH] fix: make attach required via cobra (#612) Signed-off-by: Billy Zha --- cmd/oras/attach.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/oras/attach.go b/cmd/oras/attach.go index ba855bfba..bf73a9038 100644 --- a/cmd/oras/attach.go +++ b/cmd/oras/attach.go @@ -75,6 +75,7 @@ Example - Attach a file and add manifest annotations } cmd.Flags().StringVarP(&opts.artifactType, "artifact-type", "", "", "artifact type") + cmd.MarkFlagRequired("artifact-type") option.ApplyFlags(&opts, cmd.Flags()) return cmd }