Skip to content

Commit

Permalink
Make --dry-run output more verbose by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Allison Maheu committed Mar 25, 2020
1 parent f772c32 commit bb61c9a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/ssm-run/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ func main() {

flag.Parse()

if verboseFlag == 0 && dryRunFlag {
verboseFlag = 1
}

if verboseFlag == 3 {
log.SetLevel(log.DebugLevel)
}
Expand Down Expand Up @@ -207,6 +211,12 @@ func main() {

if verboseFlag > 0 && (len(info) > 0) {
log.Infof("Fetched %d instances for account [%s] in [%s].", len(info), sess.ProfileName, *sess.Session.Config.Region)
if dryRunFlag {
log.Info("Targeted instances:")
for _, instance := range info {
log.Infof("%s", *instance.InstanceId)
}
}
}

if limitFlag == 0 || limitFlag > len(info) {
Expand Down

0 comments on commit bb61c9a

Please sign in to comment.