zrepl status: hide progress bar once all filesystems reach terminal state (#674)

* Added `IsTerminal` method
* Made rendering of progress bar conditional based on IsTerminal
This commit is contained in:
Tercio Filho
2023-05-02 14:28:56 -03:00
committed by GitHub
parent 2b3df7e342
commit 2b3daaf9f1
3 changed files with 40 additions and 15 deletions
+11
View File
@@ -192,3 +192,14 @@ func (r *Report) GetFailedFilesystemsCountInLatestAttempt() int {
return 0
}
}
// Returns true in case the AttemptState is a terminal
// state(AttemptPlanningError, AttemptFanOutError, AttemptDone)
func (a AttemptState) IsTerminal() bool {
switch a {
case AttemptPlanningError, AttemptFanOutError, AttemptDone:
return true
default:
return false
}
}