fix rm hashsum

This commit is contained in:
n4n5
2026-01-31 10:44:17 -07:00
parent ada45dbaf8
commit ad0aec270e
2 changed files with 1 additions and 31 deletions
-30
View File
@@ -275,16 +275,11 @@ fn main() -> io::Result<()> {
}
println!("Writing to utils");
let hashsum_cmd = utils.iter().find(|n| *n.0 == "hashsum").unwrap().1.1;
for (&name, (_, command)) in utils {
let (utils_name, usage_name, command) = match name {
"[" => {
continue;
}
name if is_hashsum_family(name) => {
// These use the hashsum
("hashsum", name, &hashsum_cmd)
}
n => (n, n, command),
};
let p = format!("docs/src/utils/{usage_name}.md");
@@ -334,35 +329,10 @@ fn fix_usage(name: &str, usage: String) -> String {
.collect::<Vec<_>>()
.join("\n")
}
"hashsum" => usage,
name if is_hashsum_family(name) => {
usage.replace("--<digest> ", "").replace("hashsum", name)
}
_ => usage,
}
}
fn is_hashsum_family(name: &str) -> bool {
matches!(
name,
"md5sum"
| "sha1sum"
| "sha224sum"
| "sha256sum"
| "sha384sum"
| "sha512sum"
| "sha3sum"
| "sha3-224sum"
| "sha3-256sum"
| "sha3-384sum"
| "sha3-512sum"
| "shake128sum"
| "shake256sum"
| "b2sum"
| "b3sum"
)
}
struct MDWriter<'a, 'b> {
w: Box<dyn Write>,
command: Command,
+1 -1
View File
@@ -113,7 +113,7 @@ fn uudoc_check_sums() {
.find(|one_line| one_line.contains(one_sum))
.unwrap();
let (correct_path, content) = get_doc_file_from_output(output_path);
let formatted = format!("```\n{one_sum} [OPTIONS]... [FILE]...\n```");
let formatted = format!("```\n{one_sum} [OPTIONS] [FILE]...\n```");
assert!(
content.contains(&formatted),
"Content of {correct_path} does not contain the expected format: {formatted}",