]> ruderich.org/simon Gitweb - safcm/safcm.git/blobdiff - cmd/safcm/sync_changes.go
changes: hide commands if quiet and dry-run is active
[safcm/safcm.git] / cmd / safcm / sync_changes.go
index 1ec3cb60b435632fedac3e95b975239d1f12160e..6327fd9addbaec497a31452a635082cb6f65b32e 100644 (file)
@@ -176,7 +176,7 @@ func (s *Sync) formatCommandChanges(changes []safcm.CommandChange) string {
        // Instead, quiet shows them only when they produce output (e.g.
        // `ainsl`, `rm -v`) and thus modify the host's state.
        var noOutput int
-       if s.config.Quiet && !s.config.DryRun {
+       if s.config.Quiet {
                for _, x := range changes {
                        if x.Trigger == "" &&
                                x.Error == "" &&
@@ -188,7 +188,7 @@ func (s *Sync) formatCommandChanges(changes []safcm.CommandChange) string {
 
        var buf strings.Builder
        fmt.Fprintf(&buf, "executed %d command(s)", len(changes))
-       if noOutput > 0 {
+       if noOutput > 0 && !s.config.DryRun {
                fmt.Fprintf(&buf, ", %d with no output", noOutput)
        }
        if noOutput != len(changes) {