codesysultra 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/claude_config.json +13 -0
- package/dist/bin.js +12 -23
- package/package.json +1 -1
- package/test_config.json +13 -0
package/dist/bin.js
CHANGED
|
@@ -63,29 +63,18 @@ catch (e) {
|
|
|
63
63
|
commander_1.program
|
|
64
64
|
.name('codesysultra') // Set the command name users will see
|
|
65
65
|
.description('Model Context Protocol (MCP) server for CODESYS automation platform')
|
|
66
|
-
.version(version)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
.
|
|
70
|
-
.option('-
|
|
71
|
-
.option('-v, --version-info <path>', 'Path to CODESYS version info file')
|
|
72
|
-
.option('-o, --output <path>', 'Output configuration file path (
|
|
73
|
-
|
|
74
|
-
generateConfig(options);
|
|
75
|
-
});
|
|
76
|
-
// 主命令选项
|
|
77
|
-
commander_1.program.option('-p, --codesys-path <path>', 'Path to CODESYS executable (can contain spaces, use quotes if needed)', process.env.CODESYS_PATH || 'C:\\Program Files\\CODESYS 3.5.21.0\\CODESYS\\Common\\CODESYS.exe' // Default AFTER reading env var
|
|
78
|
-
)
|
|
79
|
-
.option('-f, --codesys-profile <profile>', // Changed alias to 'f' to avoid conflict if you add other '-p' options
|
|
80
|
-
'CODESYS profile name (overrides CODESYS_PROFILE env var)', process.env.CODESYS_PROFILE || 'CODESYS V3.5 SP21' // Default AFTER reading env var
|
|
81
|
-
)
|
|
82
|
-
// Add workspace option if needed, defaults to cwd
|
|
83
|
-
.option('-w, --workspace <dir>', 'Workspace directory for relative project paths', process.cwd() // Default to current working directory
|
|
84
|
-
)
|
|
85
|
-
.parse(process.argv); // Parse the arguments
|
|
66
|
+
.version(version)
|
|
67
|
+
.option('-p, --codesys-path <path>', 'Path to CODESYS executable (can contain spaces, use quotes if needed)', process.env.CODESYS_PATH || 'C:\\Program Files\\CODESYS 3.5.21.0\\CODESYS\\Common\\CODESYS.exe')
|
|
68
|
+
.option('-f, --codesys-profile <profile>', 'CODESYS profile name (overrides CODESYS_PROFILE env var)', process.env.CODESYS_PROFILE || 'CODESYS V3.5 SP21')
|
|
69
|
+
.option('-w, --workspace <dir>', 'Workspace directory for relative project paths', process.cwd())
|
|
70
|
+
.option('-g, --generate-config', 'Generate configuration file from CODESYS version info (use with -c and -v)')
|
|
71
|
+
.option('-v, --version-info <path>', 'Path to CODESYS version info file (for config generation)')
|
|
72
|
+
.option('-o, --output <path>', 'Output configuration file path (for config generation)');
|
|
73
|
+
commander_1.program.parse(process.argv); // Parse the arguments
|
|
86
74
|
const options = commander_1.program.opts();
|
|
87
|
-
//
|
|
88
|
-
if (
|
|
75
|
+
// 如果是生成配置模式
|
|
76
|
+
if (options.generateConfig) {
|
|
77
|
+
generateConfig(options);
|
|
89
78
|
process.exit(0);
|
|
90
79
|
}
|
|
91
80
|
// --- Log options Commander parsed ---
|
|
@@ -127,7 +116,7 @@ function generateConfig(options) {
|
|
|
127
116
|
process.exit(1);
|
|
128
117
|
}
|
|
129
118
|
if (!options.codesysPath) {
|
|
130
|
-
console.error('Error: CODESYS path is required. Use -
|
|
119
|
+
console.error('Error: CODESYS path is required. Use -p or --codesys-path option.');
|
|
131
120
|
process.exit(1);
|
|
132
121
|
}
|
|
133
122
|
const versionInfoPath = path.resolve(options.versionInfo);
|
package/package.json
CHANGED
package/test_config.json
ADDED