Skip to main content

Module command_processor

Module command_processor 

Source
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ยง

CommandProcessor
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)>