* @brief Register all Process driver commands with the registry. */
| 26 | * @brief Register all Process driver commands with the registry. |
| 27 | */ |
| 28 | void API::Handlers::ProcessHandler::registerCommands() |
| 29 | { |
| 30 | auto& registry = CommandRegistry::instance(); |
| 31 | const auto empty = emptySchema(); |
| 32 | |
| 33 | registry.registerCommand(QStringLiteral("io.process.setMode"), |
| 34 | QStringLiteral("Set driver mode (params: mode - 0=Launch, 1=NamedPipe)"), |
| 35 | makeSchema({ |
| 36 | {QStringLiteral("mode"), |
| 37 | QStringLiteral("integer"), |
| 38 | QStringLiteral("Driver mode (0=Launch, 1=NamedPipe)")} |
| 39 | }), |
| 40 | &setMode); |
| 41 | |
| 42 | registry.registerCommand( |
| 43 | QStringLiteral("io.process.setExecutable"), |
| 44 | QStringLiteral("Set executable path for Launch mode (params: executable)"), |
| 45 | makeSchema({ |
| 46 | {QStringLiteral("executable"), |
| 47 | QStringLiteral("string"), |
| 48 | QStringLiteral("Absolute path to the executable")} |
| 49 | }), |
| 50 | &setExecutable); |
| 51 | |
| 52 | registry.registerCommand( |
| 53 | QStringLiteral("io.process.setArguments"), |
| 54 | QStringLiteral("Set command-line arguments for Launch mode (params: arguments)"), |
| 55 | makeSchema({ |
| 56 | {QStringLiteral("arguments"), |
| 57 | QStringLiteral("string"), |
| 58 | QStringLiteral("Shell-style argument string")} |
| 59 | }), |
| 60 | &setArguments); |
| 61 | |
| 62 | registry.registerCommand( |
| 63 | QStringLiteral("io.process.setWorkingDir"), |
| 64 | QStringLiteral("Set working directory for Launch mode (params: workingDir)"), |
| 65 | makeSchema({ |
| 66 | {QStringLiteral("workingDir"), |
| 67 | QStringLiteral("string"), |
| 68 | QStringLiteral("Absolute path to the working directory")} |
| 69 | }), |
| 70 | &setWorkingDir); |
| 71 | |
| 72 | registry.registerCommand( |
| 73 | QStringLiteral("io.process.setPipePath"), |
| 74 | QStringLiteral("Set named pipe / FIFO path for NamedPipe mode (params: pipePath)"), |
| 75 | makeSchema({ |
| 76 | {QStringLiteral("pipePath"), |
| 77 | QStringLiteral("string"), |
| 78 | QStringLiteral("Named pipe or FIFO path")} |
| 79 | }), |
| 80 | &setPipePath); |
| 81 | |
| 82 | registry.registerCommand(QStringLiteral("io.process.listRunning"), |
| 83 | QStringLiteral("Refresh and return the list of running processes"), |
| 84 | empty, |
| 85 | &getRunningProcesses); |
nothing calls this directly
no test coverage detected