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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user