Skip to content

Commit

Permalink
chore: 更新版本号至0.6.8并优化用户输入处理逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
TBXark committed Feb 6, 2025
1 parent dec3adc commit 8ad4d31
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Sources/rmtrash/rmtrash.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct Command: ParsableCommand {
commandName: "rmtrash",
abstract: "Move files and directories to the trash.",
discussion: "rmtrash is a small utility that will move the file to macOS's Trash rather than obliterating the file (as rm does).",
version: "0.6.7",
version: "0.6.8",
shouldDisplay: true,
subcommands: [],
helpNames: .long,
Expand Down Expand Up @@ -210,8 +210,10 @@ public struct CommandLineQuestion: Question {

public func ask(_ message: String) -> Bool {
print("\(message) (y/n) ", terminator: "")
let answer = readLine()
return answer?.lowercased() == "y" || answer?.lowercased() == "yes"
guard let answer = readLine() else {
return false
}
return answer.lowercased() == "y" || answer.lowercased() == "yes"
}
}

Expand Down

0 comments on commit 8ad4d31

Please sign in to comment.