diff --git a/pkg/cmd/list.go b/pkg/cmd/list.go index cba7cf8c84357c35a2d16aea1383d73d08c638df..06a176a94f167833aee1903d3f9bd5d1f15dca63 100644 --- a/pkg/cmd/list.go +++ b/pkg/cmd/list.go @@ -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) + } }, } diff --git a/pkg/cmd/root.go b/pkg/cmd/root.go index 8b32894bf0052feb9d91f6e73d26c657b2cfb5be..ee2cb4aa2f8b1c7d4014f9e1fb60e70ca7bbaf61 100644 --- a/pkg/cmd/root.go +++ b/pkg/cmd/root.go @@ -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() diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index 862218f62e53b79a703d9d9b069fb7d9a4c710b3..df06182483442b48aeb40f4e09a04f6c890f7817 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -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)) + } }, }