* Fix loglevel parsing

* Bump dependencies

* Change --filter to --target

* Update documentation

* Import log handler as "loghandler"

* Change command color to purple

* Change flag name to target

* Update formatting
This commit is contained in:
2021-07-30 22:51:20 +02:00
committed by GitHub
parent a8399397e8
commit 4a0574554a
8 changed files with 55 additions and 28 deletions

View File

@@ -65,9 +65,14 @@ func (m *Marathon) Run(instances []cloud.Instance, key *key.Key, ignoreFingerpri
pool := pond.New(m.Concurrency, 10000)
bar := pb.New(len(instances))
if log.MustParseLevel(viper.GetString("loglevel")) > 0 {
lvl, err := log.ParseLevel(viper.GetString("loglevel"))
if err != nil {
return fmt.Errorf("couldn't parse log level: %s", err)
}
if lvl > 0 {
bar.SetMaxWidth(1)
bar.SetTemplateString(fmt.Sprintf("%s Running [%s]: {{counters . }}", colors.Blue("•"), colors.Blue(m.Command)))
bar.SetTemplateString(fmt.Sprintf("%s Running [%s]: {{counters . }}", colors.Blue("•"), colors.Purple(m.Command)))
bar.Start()
}
@@ -168,7 +173,6 @@ func checkHostsFile() error {
// PrintResult prints the results of the ssh command run
func (m *Marathon) PrintResult(failures bool) {
if !failures {
for host, msg := range m.successes {
fmt.Printf(" %s:\n%s\n", colors.Green(host), colors.White(msg))