Expand description
Command script processor for Senzing .gtc files
Processes line-based command scripts to transform Senzing configuration JSON. Use cases include configuration upgrades, batch changes, templates, and automated testing.
ยงFormat
Commands follow the pattern:
commandName {"param": "value", ...}
commandName {"param": "value"}
saveยงExample
use sz_configtool_lib::command_processor::CommandProcessor;
let config = std::fs::read_to_string("g2config.json")?;
let mut processor = CommandProcessor::new(config);
let upgraded = processor.process_file("upgrade-10-to-11.gtc")?;
std::fs::write("g2config_v11.json", upgraded)?;
println!("{}", processor.summary());Structsยง
- Command
Processor - Processes Senzing command scripts (.gtc files)
Functionsยง
- execute_
command ๐ - Execute a command and return updated config
- get_
opt_ ๐str_ param - Get optional string parameter
- get_
str_ ๐param - Get required string parameter
- parse_
command_ ๐line - Parse a command line into (command_name, parameters)
- parse_
element_ ๐list - Parse elementList from JSON into Vec<(element, required, feature)>