prefer to print to stderr for console chatter

This commit is contained in:
2024-11-17 02:59:13 +11:00
parent 20e76918fe
commit c239b8e424
9 changed files with 29 additions and 10 deletions

View File

@ -15,6 +15,6 @@ struct DpkInstallCommand: ParsableCommand {
var packages: [String]
func run() throws {
print("installing \"\(packages.joined(separator: "\", \""))\"")
eprint("installing \"\(packages.joined(separator: "\", \""))\"")
}
}

View File

@ -15,6 +15,6 @@ struct DpkRemoveCommand: ParsableCommand {
var packages: [String]
func run() throws {
print("uninstalling \"\(packages.joined(separator: "\", \""))\"")
eprint("uninstalling \"\(packages.joined(separator: "\", \""))\"")
}
}

View File

@ -27,7 +27,7 @@ struct DpkSearchCommand: AsyncParsableCommand {
func run() async throws(ExitCode) {
if self.regex && self.exact {
print("Only one of \(self._regex.description) and \(self._exact.description) is allowed")
eprint("Only one of \(self._regex.description) and \(self._exact.description) is allowed")
throw .validationFailure
}
@ -46,7 +46,7 @@ struct DpkSearchCommand: AsyncParsableCommand {
do {
index = try await ApkIndex.resolve(localRepositories, fetch: .local)
} catch {
print("Failed to build package index: \(error.localizedDescription)")
eprint("Failed to build package index: \(error.localizedDescription)")
throw .failure
}

View File

@ -18,8 +18,8 @@ struct DpkUpdateCommand: AsyncParsableCommand {
func run() async throws {
let repositories = try await ApkRepositoriesConfig().repositories
print("Updating package repositories")
eprint("Updating package repositories")
let index = try await ApkIndex.resolve(repositories, fetch: self.lazyDownload ? .lazy : .update)
print("Indexed \(index.packages.count) package(s)")
eprint("Indexed \(index.packages.count) package(s)")
}
}

View File

@ -16,9 +16,9 @@ struct DpkUpgradeCommand: ParsableCommand {
func run() throws {
if packages.isEmpty {
print("upgrading system")
eprint("upgrading system")
} else {
print("upgrading invidual packages: \"\(packages.joined(separator: "\", \""))\"")
eprint("upgrading individual packages: \"\(packages.joined(separator: "\", \""))\"")
}
}
}