Skip to content
Snippets Groups Projects
Commit 0bfd83ec authored by Tamer Tas's avatar Tamer Tas
Browse files

Add --dont-prettify option to user info commands

parent 8b04f869
No related branches found
No related tags found
No related merge requests found
......@@ -71,6 +71,14 @@ var List = &cli.Command{
data = append(data, tmpl.Info().String())
}
tabular.Print([]string{"Tag", "Repository", "Created"}, data)
shouldntPrettify := GetBoolFlag(c, "dont-prettify")
if shouldntPrettify {
for _, name := range names {
fmt.Print(name, " ")
}
fmt.Println()
} else {
tabular.Print([]string{"Tag", "Repository", "Created"}, data)
}
},
}
......@@ -47,6 +47,7 @@ func Run() {
Root.AddCommand(Template)
Version.PersistentFlags().BoolP("dont-prettify", "", false, "Only print the version without fancy formatting")
Root.AddCommand(Version)
Root.Execute()
......
......@@ -14,9 +14,14 @@ import (
var Version = &cli.Command{
Use: "version",
Short: "Show the boilr version information",
Run: func(_ *cli.Command, args []string) {
Run: func(c *cli.Command, args []string) {
MustValidateArgs(args, []validate.Argument{})
tlog.Info(fmt.Sprint("Current version is ", boilr.Version))
shouldntPrettify := GetBoolFlag(c, "dont-prettify")
if shouldntPrettify {
fmt.Println(boilr.Version)
} else {
tlog.Info(fmt.Sprint("Current version is ", boilr.Version))
}
},
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment