feat: cli: consolidate schedule-related commands (#2402)

* feat: cli: consolidate schedule-related commands

This commit makes the following changes:
- renames autostart -> schedule starat
- renames ttl -> schedule stop
- renames bump -> schedule override
- adds schedule show command
- moves some cli-related stuff to util.go
This commit is contained in:
Cian Johnston
2022-06-16 18:24:10 +01:00
committed by GitHub
parent c36b0d892b
commit c9691eafcb
17 changed files with 930 additions and 1091 deletions
+8
View File
@@ -17,6 +17,14 @@ func NilOrEmpty(s *string) bool {
return s == nil || *s == ""
}
// NilToEmpty coalesces a nil str to the empty string.
func NilToEmpty(s *string) string {
if s == nil {
return ""
}
return *s
}
// NilOrZero returns true if v is nil or 0.
func NilOrZero[T number](v *T) bool {
return v == nil || *v == 0