Skip to content

Commit 3a85e62

Browse files
committed
chore: fix duplicate flags for create command
1 parent 192e4e6 commit 3a85e62

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pkg/util/flags/flags.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ func buildOneFlag(cmd *cobra.Command, k string, s *spec.Schema, isArray bool) er
105105
if len(s.Type) > 0 {
106106
tpe = s.Type[0]
107107
}
108-
108+
if cmd.Flags().Lookup(name) != nil {
109+
// flag already exists, skip
110+
return nil
111+
}
109112
if isArray {
110113
switch tpe {
111114
case typeString:

0 commit comments

Comments
 (0)