Skip to content

Commit fb2f3b3

Browse files
shanselmanclaude
andcommitted
Restore --register flag for troubleshooting
Keep --register as a manual way to re-register the app for notifications when auto-registration fails or needs to be refreshed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ba1a616 commit fb2f3b3

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

main.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ void print_usage() {
287287
<< L" -h, --help Show this help\n"
288288
<< L" --install [agent] Install hooks for AI CLI agents (claude, gemini, copilot, or all)\n"
289289
<< L" --uninstall Remove hooks from all AI CLI agents\n"
290-
<< L" --status Show installation status\n\n"
290+
<< L" --status Show installation status\n"
291+
<< L" --register Re-register app for notifications (troubleshooting)\n\n"
291292
<< L"Note: Toasty auto-detects known parent processes (Claude, Copilot, etc.)\n"
292293
<< L" and applies the appropriate preset automatically. Use --app to override.\n\n"
293294
<< L"Examples:\n"
@@ -1358,6 +1359,7 @@ int wmain(int argc, wchar_t* argv[]) {
13581359
bool doUninstall = false;
13591360
bool doStatus = false;
13601361
bool doFocus = false;
1362+
bool doRegister = false;
13611363
std::wstring installAgent;
13621364
bool explicitApp = false; // Track if user explicitly set --app
13631365
bool explicitTitle = false; // Track if user explicitly set -t
@@ -1404,6 +1406,9 @@ int wmain(int argc, wchar_t* argv[]) {
14041406
else if (arg == L"--focus") {
14051407
doFocus = true;
14061408
}
1409+
else if (arg == L"--register") {
1410+
doRegister = true;
1411+
}
14071412
else if (arg == L"-t" || arg == L"--title") {
14081413
if (i + 1 < argc) {
14091414
title = argv[++i];
@@ -1488,6 +1493,16 @@ int wmain(int argc, wchar_t* argv[]) {
14881493
return result ? 0 : 1;
14891494
}
14901495

1496+
if (doRegister) {
1497+
if (create_shortcut()) {
1498+
std::wcout << L"App registered for notifications.\n";
1499+
return 0;
1500+
} else {
1501+
std::wcerr << L"Failed to register app.\n";
1502+
return 1;
1503+
}
1504+
}
1505+
14911506
if (message.empty()) {
14921507
std::wcerr << L"Error: Message is required.\n";
14931508
print_usage();

0 commit comments

Comments
 (0)