uudoc: update to clap 4
@@ -109,7 +109,7 @@ fn main() -> io::Result<()> {
struct MDWriter<'a, 'b> {
w: Box<dyn Write>,
- command: Command<'a>,
+ command: Command,
name: &'a str,
tldr_zip: &'b mut Option<ZipArchive<File>>,
utils_per_platform: &'b HashMap<&'b str, Vec<String>>,
@@ -167,13 +167,16 @@ impl<'a, 'b> MDWriter<'a, 'b> {
let mut usage: String = self
.command
.render_usage()
+ .to_string()
.lines()
.skip(1)
.map(|l| l.trim())
.filter(|l| !l.is_empty())
.collect::<Vec<_>>()
.join("\n");
- usage = usage.replace(uucore::execution_phrase(), self.name);
+ usage = usage
+ .to_string()
+ .replace(uucore::execution_phrase(), self.name);
writeln!(self.w, "{}", usage)?;
writeln!(self.w, "```")
}
@@ -282,7 +285,10 @@ impl<'a, 'b> MDWriter<'a, 'b> {
writeln!(
self.w,
"<dd>\n\n{}\n\n</dd>",
- arg.get_help().unwrap_or_default().replace('\n', "<br />")
+ arg.get_help()
+ .unwrap_or_default()
+ .to_string()
+ .replace('\n', "<br />")
)?;
}
writeln!(self.w, "</dl>\n")
