mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-11 12:09:03 +00:00
fix(cli): warn on tokens --variant without --api-key; list bar serve in help
'ccs tokens --variant <x>' without --api-key was a silent no-op; now it explains that --variant only applies with --api-key. Add the existing 'serve' subcommand to the bar help Commands list.
This commit is contained in:
1 parent
a5feefe45a
commit
5e4a90b3e5
2 files changed
+8
No files matched your search
@@ -14,6 +14,7 @@ export async function showHelp(): Promise<void> {
|
|||||||
'Commands:',
|
'Commands:',
|
||||||
[
|
[
|
||||||
['launch', 'Spawn the server detached, write ~/.ccs/bar.json, open the app (default)'],
|
['launch', 'Spawn the server detached, write ~/.ccs/bar.json, open the app (default)'],
|
||||||
|
['serve', 'Run the CCS Bar server in the foreground (used internally by launch)'],
|
||||||
['stop', 'Stop the detached CCS Bar server'],
|
['stop', 'Stop the detached CCS Bar server'],
|
||||||
['status', 'Show whether the CCS Bar server is running'],
|
['status', 'Show whether the CCS Bar server is running'],
|
||||||
['install', 'Download CCS Bar from the ccs-bar-latest GitHub release into ~/Applications'],
|
['install', 'Download CCS Bar from the ccs-bar-latest GitHub release into ~/Applications'],
|
||||||
|
|||||||
@@ -141,6 +141,13 @@ export async function handleTokensCommand(args: string[]): Promise<number> {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --variant without --api-key is a misuse — it has no effect without a key to assign.
|
||||||
|
if (variantValue !== undefined && !hasApiKeyFlag) {
|
||||||
|
console.error(fail('--variant requires --api-key'));
|
||||||
|
console.error(info('Usage: ccs tokens --variant <name> --api-key <key>'));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
let updated = false;
|
let updated = false;
|
||||||
|
|
||||||
if (regenerateSecretFlag) {
|
if (regenerateSecretFlag) {
|
||||||
|
|||||||
Reference in new issue
Block a user