fix(cli,daemon,snmp): normalize CLI argument parsing and extract daemon monitoring helpers with stronger SNMP typing

This commit is contained in:
2026-04-14 14:27:29 +00:00
parent 2adf1d5548
commit 1f542ca271
22 changed files with 1571 additions and 702 deletions
+4 -4
View File
@@ -19,7 +19,7 @@ export class NupstCli {
/**
* Parse command line arguments and execute the appropriate command
* @param args Command line arguments (process.argv)
* @param args Command line arguments excluding runtime and script path
*/
public async parseAndExecute(args: string[]): Promise<void> {
// Extract debug and version flags from any position
@@ -38,8 +38,8 @@ export class NupstCli {
}
// Get the command (default to help if none provided)
const command = debugOptions.cleanedArgs[2] || 'help';
const commandArgs = debugOptions.cleanedArgs.slice(3);
const command = debugOptions.cleanedArgs[0] || 'help';
const commandArgs = debugOptions.cleanedArgs.slice(1);
// Route to the appropriate command handler
await this.executeCommand(command, commandArgs, debugOptions.debugMode);
@@ -98,7 +98,7 @@ export class NupstCli {
await serviceHandler.start();
break;
case 'status':
await serviceHandler.status();
await serviceHandler.status(debugMode);
break;
case 'logs':
await serviceHandler.logs();