refactor: switch to go mod
This hopefully makes it a little easier to work with as the tooling is now based on something in golang core. - move columnize usage to common plugin - remove old vendor files
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
"unicode"
|
||||
|
||||
sh "github.com/codeskyblue/go-sh"
|
||||
columnize "github.com/ryanuber/columnize"
|
||||
)
|
||||
|
||||
type errfunc func() error
|
||||
@@ -100,6 +101,17 @@ func AskForDestructiveConfirmation(name string, objectType string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// CommandUsage outputs help for a command
|
||||
func CommandUsage(helpHeader string, helpContent string) {
|
||||
config := columnize.DefaultConfig()
|
||||
config.Delim = ","
|
||||
config.Prefix = " "
|
||||
config.Empty = ""
|
||||
content := strings.Split(helpContent, "\n")[1:]
|
||||
fmt.Println(helpHeader)
|
||||
fmt.Println(columnize.Format(content, config))
|
||||
}
|
||||
|
||||
// DockerCleanup cleans up all exited/dead containers and removes all dangling images
|
||||
func DockerCleanup(appName string, forceCleanup bool) error {
|
||||
if !forceCleanup {
|
||||
|
||||
Reference in New Issue
Block a user