@@ -21,19 +21,23 @@ import (
21
21
"github.com/spf13/cobra"
22
22
)
23
23
24
- var toml bool
24
+ var asFile bool
25
25
26
26
func NewPrintDepsCmd () * cobra.Command {
27
27
printDepsCmd := & cobra.Command {
28
28
Use : "print-deps" ,
29
29
Short : "Print dependencies expected by the Operator SDK" ,
30
30
Long : `The operator-sdk print-deps command prints all dependencies expected by this
31
31
version of the Operator SDK. Versions for these dependencies should match those
32
- in an operators' Gopkg.toml file.` ,
32
+ in an operators' Gopkg.toml file.
33
+
34
+ print-deps prints in columnar format by default. Use the --as-file flag to
35
+ print in Gopkg.toml file format.
36
+ ` ,
33
37
Run : printDepsFunc ,
34
38
}
35
39
36
- printDepsCmd .Flags ().BoolVar (& toml , "toml " , false , "Print dependencies in Gopkg.toml format." )
40
+ printDepsCmd .Flags ().BoolVar (& asFile , "as-file " , false , "Print dependencies in Gopkg.toml file format." )
37
41
38
42
return printDepsCmd
39
43
}
@@ -42,10 +46,10 @@ func printDepsFunc(cmd *cobra.Command, args []string) {
42
46
if len (args ) != 0 {
43
47
log .Fatal ("print-deps command does not take any arguments" )
44
48
}
45
- if toml {
46
- scaffold .PrintGopkgToml ()
49
+ if asFile {
50
+ scaffold .PrintDepsAsFile ()
47
51
} else {
48
- if err := scaffold .PrintGopkgDeps (); err != nil {
52
+ if err := scaffold .PrintDeps (); err != nil {
49
53
log .Fatalf ("print deps: (%v)" , err )
50
54
}
51
55
}
0 commit comments