Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,5 @@ pub struct Flags {
pub parse_all_lines: bool,
pub lossless: bool,
pub output_tree: OutputTree,
pub obfuscate_passwords: bool,
}
5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ struct Args {
/// Specify the output tree root folder: domain or db (default)
#[arg(short = 't', long = "output_tree", value_enum, default_value_t = OutputTree::Db)]
output_tree: OutputTree,

/// Replace password values in sanitized output with bullet placeholders (••••••••)
#[arg(long)]
obfuscate_passwords: bool,
}

#[derive(Debug, Default)]
Expand All @@ -60,6 +64,7 @@ fn main() -> Result<()> {
parse_all_lines: args.all_lines,
lossless: args.lossless,
output_tree: args.output_tree,
obfuscate_passwords: args.obfuscate_passwords,
};

valid_dir_or_throw(&in_dir)?;
Expand Down
2 changes: 1 addition & 1 deletion src/script_sanitizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fn parse_script_xml(xml_content: &str, flags: &Flags) -> Option<ScriptInfo> {
if depth == 2 && e.name().as_ref() == b"Step" {
in_step = false;
let is_comment = id_to_script_step(step_info.id) == ScriptStep::Comment;
if let Some(text) = sanitize(step_info.id, &step_info.content) {
if let Some(text) = sanitize(step_info.id, &step_info.content, flags) {
for (i, line) in text.split('\r').enumerate() {
let extra_indent = if i > 0 && !is_comment { 4 } else { 0 };
let indent_count = step_info.indent_level_current + extra_indent;
Expand Down
Loading
Loading