@@ -26,13 +26,15 @@ func newGraphCmd() *cobra.Command {
2626 Short : "Outputs the internal dependency graph for installer" ,
2727 Long : "" ,
2828 Args : cobra .ExactArgs (0 ),
29- RunE : runGraphCmd ,
29+ RunE : func (cmd * cobra.Command , args []string ) error {
30+ return runGraphCmd (cmd , args , targets )
31+ },
3032 }
3133 cmd .PersistentFlags ().StringVar (& graphOpts .outputFile , "output-file" , "" , "file where the graph is written, if empty prints the graph to Stdout." )
3234 return cmd
3335}
3436
35- func runGraphCmd (cmd * cobra.Command , args []string ) error {
37+ func runGraphCmd (cmd * cobra.Command , args []string , cmdTargets [] target ) error {
3638 g := gographviz .NewGraph ()
3739 g .SetName ("G" )
3840 g .SetDir (true )
@@ -42,7 +44,7 @@ func runGraphCmd(cmd *cobra.Command, args []string) error {
4244 string (gographviz .Shape ): "box" ,
4345 string (gographviz .Style ): "filled" ,
4446 }
45- for _ , t := range targets {
47+ for _ , t := range cmdTargets {
4648 name := fmt .Sprintf ("%q" , fmt .Sprintf ("Target %s" , t .name ))
4749 g .AddNode ("G" , name , tNodeAttr )
4850 for _ , dep := range t .assets {
0 commit comments