Make UnsupportedOSError more user-friendly (#192)

* Make UnsupportedOSError more user-friendly

* tart prune: allow only specifying a --gc flag
This commit is contained in:
Nikolay Edigaryev 2022-08-24 23:03:54 +04:00 committed by GitHub
parent 59393df2e1
commit 195a4b3a72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -20,8 +20,8 @@ struct Prune: AsyncParsableCommand {
var gc: Bool = false
func validate() throws {
if olderThan == nil && cacheBudget == nil {
throw ValidationError("at least one criteria must be specified")
if olderThan == nil && cacheBudget == nil && !gc {
throw ValidationError("at least one pruning criteria must be specified")
}
}

View File

@ -10,7 +10,8 @@ struct NoMainScreenFoundError: Error {
struct DownloadFailed: Error {
}
struct UnsupportedOSError: Error {
struct UnsupportedOSError: Error, CustomStringConvertible {
private(set) var description: String = "error: Linux VMs are only supported on macOS 13.0 (Ventura) or newer"
}
struct UnsupportedArchitectureError: Error {