mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-12 22:14:22 +00:00
fix(update): add --help support and --dev alias for update command
This commit is contained in:
1 parent
2126e83da6
commit
b18163c57b
1 file changed
+20
-1
+20
-1
@@ -241,8 +241,27 @@ async function main(): Promise<void> {
|
|||||||
// Special case: update command
|
// Special case: update command
|
||||||
if (firstArg === 'update' || firstArg === '--update') {
|
if (firstArg === 'update' || firstArg === '--update') {
|
||||||
const updateArgs = args.slice(1);
|
const updateArgs = args.slice(1);
|
||||||
|
|
||||||
|
// Handle --help for update command
|
||||||
|
if (updateArgs.includes('--help') || updateArgs.includes('-h')) {
|
||||||
|
console.log('');
|
||||||
|
console.log('Usage: ccs update [options]');
|
||||||
|
console.log('');
|
||||||
|
console.log('Options:');
|
||||||
|
console.log(' --force Force reinstall current version');
|
||||||
|
console.log(' --beta, --dev Install from dev channel (unstable)');
|
||||||
|
console.log(' --help, -h Show this help message');
|
||||||
|
console.log('');
|
||||||
|
console.log('Examples:');
|
||||||
|
console.log(' ccs update Update to latest stable');
|
||||||
|
console.log(' ccs update --force Force reinstall');
|
||||||
|
console.log(' ccs update --beta Install dev channel');
|
||||||
|
console.log('');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const forceFlag = updateArgs.includes('--force');
|
const forceFlag = updateArgs.includes('--force');
|
||||||
const betaFlag = updateArgs.includes('--beta');
|
const betaFlag = updateArgs.includes('--beta') || updateArgs.includes('--dev');
|
||||||
await handleUpdateCommand({ force: forceFlag, beta: betaFlag });
|
await handleUpdateCommand({ force: forceFlag, beta: betaFlag });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user