forked from hwaf/hwaf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmd_waf_show_setup.go
57 lines (49 loc) · 1.05 KB
/
cmd_waf_show_setup.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package main
import (
"fmt"
"github.com/gonuts/commander"
"github.com/gonuts/flag"
)
func hwaf_make_cmd_waf_show_setup() *commander.Command {
cmd := &commander.Command{
Run: hwaf_run_cmd_waf_show_setup,
UsageLine: "setup",
Short: "show setup informations",
Long: `
show setup displays the setup informations.
ex:
$ hwaf show setup
`,
Flag: *flag.NewFlagSet("hwaf-waf-show-setup", flag.ExitOnError),
}
return cmd
}
func hwaf_run_cmd_waf_show_setup(cmd *commander.Command, args []string) {
var err error
//n := "hwaf-" + cmd.Name()
workdir, err := g_ctx.Workarea()
if err != nil {
workdir = "<N/A>"
}
fmt.Printf("workarea=%s\n", workdir)
lconf, err := g_ctx.LocalCfg()
if err != nil {
handle_err(
fmt.Errorf("%v\ndid you forget to run 'hwaf setup' ?", err),
)
}
for _, k := range [][]string{
{"hwaf-cfg", "cmtcfg"},
{"hwaf-cfg", "projects"},
} {
section := k[0]
option := k[1]
v := ""
v, err = lconf.String(section, option)
if err != nil {
v = "<N/A>"
}
fmt.Printf("%s=%s\n", option, v)
}
}
// EOF