github.com/hwaf/hwaf@v0.0.0-20140814122253-5465f73b20f1/cmd_waf_show_constituents.go (about) 1 package main 2 3 import ( 4 "os" 5 6 "github.com/gonuts/commander" 7 "github.com/gonuts/flag" 8 ) 9 10 func hwaf_make_cmd_waf_show_constituents() *commander.Command { 11 cmd := &commander.Command{ 12 Run: hwaf_run_cmd_waf_show_constituents, 13 UsageLine: "constituents [options] [<package name> [<package-name> [...]]]", 14 Short: "show targets of a project or package", 15 Long: ` 16 show constituents displays the list of targets which will be built. 17 18 ex: 19 $ hwaf show constituents 20 $ hwaf show constituents Control/AthenaCommon 21 `, 22 Flag: *flag.NewFlagSet("hwaf-waf-show-constituents", flag.ExitOnError), 23 CustomFlags: true, 24 } 25 return cmd 26 } 27 28 func hwaf_run_cmd_waf_show_constituents(cmd *commander.Command, args []string) error { 29 var err error 30 //n := "hwaf-" + cmd.Name() 31 32 waf, err := g_ctx.WafBin() 33 if err != nil { 34 return err 35 } 36 37 subargs := append([]string{"list"}, args...) 38 sub := g_ctx.Command(waf, subargs...) 39 sub.Stdout = os.Stdout 40 sub.Stderr = os.Stderr 41 return sub.Run() 42 } 43 44 // EOF