cli layout updated

This commit is contained in:
alessio 2017-03-20 00:31:52 +01:00
parent f613fef73a
commit e88c08c44b
2 changed files with 29 additions and 27 deletions

View File

@ -177,7 +177,7 @@ func main() {
fmt.Println(p.String("path")) fmt.Println(p.String("path"))
handle(r.Blueprint.Add(p)) handle(r.Blueprint.Add(p))
handle(r.Record(r)) handle(r.Record(r))
fmt.Println(r.Green.Bold("Your project was successfully added.")) fmt.Println(r.Yellow.Bold("[")+"REALIZE"+r.Yellow.Bold("]"), r.Green.Bold("Your project was successfully added."))
return nil return nil
}, },
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
@ -853,7 +853,7 @@ func main() {
}, },
}) })
handle(r.Record(r)) handle(r.Record(r))
fmt.Println(r.Green.Bold("Your project was successfully added.")) fmt.Println(r.Yellow.Bold("[")+"REALIZE"+r.Yellow.Bold("]"), r.Green.Bold("Your project was successfully added."))
return nil return nil
}, },
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
@ -871,7 +871,7 @@ func main() {
Action: func(p *cli.Context) error { Action: func(p *cli.Context) error {
handle(r.Blueprint.Remove(p)) handle(r.Blueprint.Remove(p))
handle(r.Record(r)) handle(r.Record(r))
fmt.Println(r.Green.Bold("Your project was successfully removed.")) fmt.Println(r.Yellow.Bold("[")+"REALIZE"+r.Yellow.Bold("]"), r.Green.Bold("Your project was successfully removed."))
return nil return nil
}, },
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {
@ -897,7 +897,7 @@ func main() {
Usage: "Remove realize folder.", Usage: "Remove realize folder.",
Action: func(p *cli.Context) error { Action: func(p *cli.Context) error {
handle(r.Settings.Remove()) handle(r.Settings.Remove())
fmt.Println(r.Green.Bold("Realize folder successfully removed.")) fmt.Println(r.Yellow.Bold("[")+"REALIZE"+r.Yellow.Bold("]"), r.Green.Bold("Realize folder successfully removed."))
return nil return nil
}, },
Before: func(c *cli.Context) error { Before: func(c *cli.Context) error {

View File

@ -88,47 +88,49 @@ func (h *Blueprint) List() error {
err := h.check() err := h.check()
if err == nil { if err == nil {
for _, val := range h.Projects { for _, val := range h.Projects {
fmt.Println(h.Blue.Bold("|"), h.Blue.Bold(strings.ToUpper(val.Name))) fmt.Println(h.Blue.Bold("[") + strings.ToUpper(val.Name) + h.Blue.Bold("]"))
fmt.Println(h.Magenta.Regular("|"), "\t", h.Yellow.Regular("Base Path"), ":", h.Magenta.Regular(val.Path)) name := h.Magenta.Bold("[") + strings.ToUpper(val.Name) + h.Magenta.Bold("]")
fmt.Println(h.Magenta.Regular("|"), "\t", h.Yellow.Regular("Fmt"), ":", h.Magenta.Regular(val.Fmt))
fmt.Println(h.Magenta.Regular("|"), "\t", h.Yellow.Regular("Generate"), ":", h.Magenta.Regular(val.Generate)) fmt.Println(name, h.Yellow.Regular("Base Path"), ":", h.Magenta.Regular(val.Path))
fmt.Println(h.Magenta.Regular("|"), "\t", h.Yellow.Regular("Test"), ":", h.Magenta.Regular(val.Test)) fmt.Println(name, h.Yellow.Regular("Fmt"), ":", h.Magenta.Regular(val.Fmt))
fmt.Println(h.Magenta.Regular("|"), "\t", h.Yellow.Regular("Install"), ":", h.Magenta.Regular(val.Bin)) fmt.Println(name, h.Yellow.Regular("Generate"), ":", h.Magenta.Regular(val.Generate))
fmt.Println(h.Magenta.Regular("|"), "\t", h.Yellow.Regular("Build"), ":", h.Magenta.Regular(val.Build)) fmt.Println(name, h.Yellow.Regular("Test"), ":", h.Magenta.Regular(val.Test))
fmt.Println(h.Magenta.Regular("|"), "\t", h.Yellow.Regular("Run"), ":", h.Magenta.Regular(val.Run)) fmt.Println(name, h.Yellow.Regular("Install"), ":", h.Magenta.Regular(val.Bin))
fmt.Println(name, h.Yellow.Regular("Build"), ":", h.Magenta.Regular(val.Build))
fmt.Println(name, h.Yellow.Regular("Run"), ":", h.Magenta.Regular(val.Run))
if len(val.Params) > 0 { if len(val.Params) > 0 {
fmt.Println(h.Magenta.Regular("|"), "\t", h.Yellow.Regular("Params"), ":", h.Magenta.Regular(val.Params)) fmt.Println(name, h.Yellow.Regular("Params"), ":", h.Magenta.Regular(val.Params))
} }
fmt.Println(h.Magenta.Regular("|"), "\t", h.Yellow.Regular("Watcher"), ":") fmt.Println(name, h.Yellow.Regular("Watcher"), ":")
fmt.Println(h.Magenta.Regular("|"), "\t\t", h.Yellow.Regular("Preview"), ":", h.Magenta.Regular(val.Watcher.Preview)) fmt.Println(name, "\t", h.Yellow.Regular("Preview"), ":", h.Magenta.Regular(val.Watcher.Preview))
if len(val.Watcher.Exts) > 0 { if len(val.Watcher.Exts) > 0 {
fmt.Println(h.Magenta.Regular("|"), "\t\t", h.Yellow.Regular("Extensions"), ":", h.Magenta.Regular(val.Watcher.Exts)) fmt.Println(name, "\t", h.Yellow.Regular("Extensions"), ":", h.Magenta.Regular(val.Watcher.Exts))
} }
if len(val.Watcher.Paths) > 0 { if len(val.Watcher.Paths) > 0 {
fmt.Println(h.Magenta.Regular("|"), "\t\t", h.Yellow.Regular("Paths"), ":", h.Magenta.Regular(val.Watcher.Paths)) fmt.Println(name, "\t", h.Yellow.Regular("Paths"), ":", h.Magenta.Regular(val.Watcher.Paths))
} }
if len(val.Watcher.Ignore) > 0 { if len(val.Watcher.Ignore) > 0 {
fmt.Println(h.Magenta.Regular("|"), "\t\t", h.Yellow.Regular("Ignored paths"), ":", h.Magenta.Regular(val.Watcher.Ignore)) fmt.Println(name, "\t", h.Yellow.Regular("Ignored paths"), ":", h.Magenta.Regular(val.Watcher.Ignore))
} }
if len(val.Watcher.Scripts) > 0 { if len(val.Watcher.Scripts) > 0 {
fmt.Println(h.Magenta.Regular("|"), "\t\t", h.Yellow.Regular("Scripts"), ":") fmt.Println(name, "\t", h.Yellow.Regular("Scripts"), ":")
for _, v := range val.Watcher.Scripts { for _, v := range val.Watcher.Scripts {
if v.Command != "" { if v.Command != "" {
fmt.Println(h.Magenta.Regular("|"), "\t\t\t", h.Magenta.Regular("-"), h.Yellow.Regular("Command"), ":", h.Magenta.Regular(v.Command)) fmt.Println(name, "\t\t", h.Magenta.Regular("-"), h.Yellow.Regular("Command"), ":", h.Magenta.Regular(v.Command))
if v.Path != "" { if v.Path != "" {
fmt.Println(h.Magenta.Regular("|"), "\t\t\t", h.Yellow.Regular("Path"), ":", h.Magenta.Regular(v.Path)) fmt.Println(name, "\t\t", h.Yellow.Regular("Path"), ":", h.Magenta.Regular(v.Path))
} }
if v.Type != "" { if v.Type != "" {
fmt.Println(h.Magenta.Regular("|"), "\t\t\t", h.Yellow.Regular("Type"), ":", h.Magenta.Regular(v.Type)) fmt.Println(name, "\t\t", h.Yellow.Regular("Type"), ":", h.Magenta.Regular(v.Type))
} }
} }
} }
} }
fmt.Println(h.Magenta.Regular("|"), "\t", h.Yellow.Regular("Streams"), ":") fmt.Println(name, h.Yellow.Regular("Streams"), ":")
fmt.Println(h.Magenta.Regular("|"), "\t\t", h.Yellow.Regular("Cli Out"), ":", h.Magenta.Regular(val.Streams.CliOut)) fmt.Println(name, "\t", h.Yellow.Regular("Cli Out"), ":", h.Magenta.Regular(val.Streams.CliOut))
fmt.Println(h.Magenta.Regular("|"), "\t\t", h.Yellow.Regular("File Out"), ":", h.Magenta.Regular(val.Streams.FileOut)) fmt.Println(name, "\t", h.Yellow.Regular("File Out"), ":", h.Magenta.Regular(val.Streams.FileOut))
fmt.Println(h.Magenta.Regular("|"), "\t\t", h.Yellow.Regular("File Log"), ":", h.Magenta.Regular(val.Streams.FileLog)) fmt.Println(name, "\t", h.Yellow.Regular("File Log"), ":", h.Magenta.Regular(val.Streams.FileLog))
fmt.Println(h.Magenta.Regular("|"), "\t\t", h.Yellow.Regular("File Err"), ":", h.Magenta.Regular(val.Streams.FileErr)) fmt.Println(name, "\t", h.Yellow.Regular("File Err"), ":", h.Magenta.Regular(val.Streams.FileErr))
} }
return nil return nil
} }