mirror of
https://github.com/mas-cli/mas
synced 2024-11-21 19:23:01 +00:00
Single source for Unknown app ID message.
Resolve #533 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
This commit is contained in:
parent
31dfe81174
commit
1b43c89bec
3 changed files with 8 additions and 2 deletions
|
@ -63,7 +63,7 @@ extension MAS {
|
|||
// argument is an AppID, lookup apps by id using argument
|
||||
let installedApps = appLibrary.installedApps(withAppID: appID)
|
||||
if installedApps.isEmpty {
|
||||
printError("Unknown app ID \(appID)")
|
||||
printError(appID.unknownMessage)
|
||||
}
|
||||
return installedApps
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ extension MASError: CustomStringConvertible {
|
|||
case .noSearchResultsFound:
|
||||
return "No apps found"
|
||||
case .unknownAppID(let appID):
|
||||
return "Unknown app ID \(appID)"
|
||||
return appID.unknownMessage
|
||||
case .noVendorWebsite:
|
||||
return "App does not have a vendor website"
|
||||
case .notInstalled(let appID):
|
||||
|
|
|
@ -10,6 +10,12 @@ import Foundation
|
|||
|
||||
typealias AppID = UInt64
|
||||
|
||||
extension AppID {
|
||||
var unknownMessage: String {
|
||||
"Unknown app ID \(self)"
|
||||
}
|
||||
}
|
||||
|
||||
extension NSNumber {
|
||||
var appIDValue: AppID {
|
||||
uint64Value
|
||||
|
|
Loading…
Reference in a new issue