Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- `removemacai background` with an action other than `off` or `on`, such as the typo `of`, now fails and says which actions it takes, instead of listing the items and exiting 0 (#82).
- The app is translated into Hindi and Urdu (#101). Urdu keeps the names of macOS screens and buttons in English, since macOS has no Urdu interface.
- Block Music launches is now called Stop Music from opening, even by hand, and its warning says Music won't open at all until you undo it. The old name read as if only AirPods were blocked (#67).

Expand Down
6 changes: 6 additions & 0 deletions Sources/removemacai/SelfTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ func selfTest() -> Bool {
check(unknownCommand.status == 1 && unknownCommandOutput.contains("error: unknown command \"stauts\"")
&& unknownCommandOutput.contains("Did you mean \"status\"?"),
"an unknown command fails naming the typo instead of printing bare usage")
let unknownAction = Shell.run(executable, ["background", "of"])
let unknownActionOutput = unknownAction.output.replacingOccurrences(
of: #"\x1B\[[0-9;]*m"#, with: "", options: .regularExpression)
check(unknownAction.status == 1
&& unknownActionOutput.trimmingCharacters(in: .whitespacesAndNewlines) == "error: unknown action \"of\", use off or on",
"background fails on an unknown action instead of listing items")

check(Set(Catalog.setsToRemove(keeping: [])) == Set(Catalog.availableModelSets.map(\.name)),
"off removes every model set this macOS has")
Expand Down
5 changes: 4 additions & 1 deletion Sources/removemacai/TweakCommands.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,12 @@ enum TweakCommands {
// MARK: background items

static func background(_ args: [String], yes: Bool) -> Bool {
if let action = args.first, action != "off" && action != "on" {
Term.fail("unknown action \"\(action)\", use off or on")
}
let items = BackgroundItems.scan()
let labels = BackgroundItems.disabledLabels()
guard let action = args.first, action == "off" || action == "on" else {
guard let action = args.first else {
Commands.header()
if items.isEmpty {
print("No background items from other apps.")
Expand Down
Loading