diff --git a/ts/cli.ts b/ts/cli.ts index 49225ac..8506538 100644 --- a/ts/cli.ts +++ b/ts/cli.ts @@ -127,8 +127,7 @@ export class NupstCli { break; } case 'remove': - case 'rm': // Alias - case 'delete': { // Backward compatibility + case 'rm': { const upsIdToRemove = subcommandArgs[0]; if (!upsIdToRemove) { logger.error('UPS ID is required for remove command'); @@ -172,8 +171,7 @@ export class NupstCli { break; } case 'remove': - case 'rm': // Alias - case 'delete': { // Backward compatibility + case 'rm': { const groupIdToRemove = subcommandArgs[0]; if (!groupIdToRemove) { logger.error('Group ID is required for remove command'); @@ -206,8 +204,7 @@ export class NupstCli { break; } case 'remove': - case 'rm': // Alias - case 'delete': { // Backward compatibility + case 'rm': { const upsId = subcommandArgs[0]; const actionIndex = subcommandArgs[1]; await actionHandler.remove(upsId, actionIndex); @@ -242,72 +239,8 @@ export class NupstCli { return; } - // Handle top-level commands and backward compatibility + // Handle top-level commands switch (command) { - // Backward compatibility - old UPS commands - case 'add': - logger.log("Note: 'nupst add' is deprecated. Use 'nupst ups add' instead."); - await upsHandler.add(); - break; - case 'edit': - logger.log("Note: 'nupst edit' is deprecated. Use 'nupst ups edit' instead."); - await upsHandler.edit(commandArgs[0]); - break; - case 'delete': - logger.log("Note: 'nupst delete' is deprecated. Use 'nupst ups remove' instead."); - if (!commandArgs[0]) { - logger.error('UPS ID is required for delete command'); - this.showHelp(); - return; - } - await upsHandler.remove(commandArgs[0]); - break; - case 'list': - logger.log("Note: 'nupst list' is deprecated. Use 'nupst ups list' instead."); - await upsHandler.list(); - break; - case 'test': - logger.log("Note: 'nupst test' is deprecated. Use 'nupst ups test' instead."); - await upsHandler.test(debugMode); - break; - case 'setup': - logger.log("Note: 'nupst setup' is deprecated. Use 'nupst ups edit' instead."); - await upsHandler.edit(undefined); - break; - - // Backward compatibility - old service commands - case 'enable': - logger.log("Note: 'nupst enable' is deprecated. Use 'nupst service enable' instead."); - await serviceHandler.enable(); - break; - case 'disable': - logger.log("Note: 'nupst disable' is deprecated. Use 'nupst service disable' instead."); - await serviceHandler.disable(); - break; - case 'start': - logger.log("Note: 'nupst start' is deprecated. Use 'nupst service start' instead."); - await serviceHandler.start(); - break; - case 'stop': - logger.log("Note: 'nupst stop' is deprecated. Use 'nupst service stop' instead."); - await serviceHandler.stop(); - break; - case 'status': - logger.log("Note: 'nupst status' is deprecated. Use 'nupst service status' instead."); - await serviceHandler.status(); - break; - case 'logs': - logger.log("Note: 'nupst logs' is deprecated. Use 'nupst service logs' instead."); - await serviceHandler.logs(); - break; - case 'daemon-start': - logger.log( - "Note: 'nupst daemon-start' is deprecated. Use 'nupst service start-daemon' instead.", - ); - await serviceHandler.daemonStart(debugMode); - break; - - // Top-level commands (no changes) case 'update': await serviceHandler.update(); break; @@ -589,11 +522,6 @@ export class NupstCli { logger.dim(' nupst group list # Show all configured groups'); logger.dim(' nupst config # Display current configuration'); console.log(''); - - // Note about deprecated commands - logger.warn('Note: Old command format (e.g., \'nupst add\') still works but is deprecated.'); - logger.dim(' Use the new format (e.g., \'nupst ups add\') going forward.'); - console.log(''); } /** @@ -692,7 +620,7 @@ Usage: Subcommands: add - Add a new action to a UPS or group interactively - remove - Remove an action by index (alias: rm, delete) + remove - Remove an action by index (alias: rm) list [ups-id|group-id] - List all actions (optionally for specific target) (alias: ls) Options: