Clap v3: ArgMatches::usage method doesn't exist anylonger

I'm migrating some tools from clap v2 to v3. In v2 there was method ArgMatches::usage(). For example the following code:

use clap::{App, Arg};
fn main() {
    let m = App::new("myprog")
        .arg(Arg::with_name("debug").short("d"))
        .get_matches_from(vec!["myprog", "-d"]);

    println!("{}", m.usage());
}

Prints

USAGE:
    myprog [FLAGS]

The question is if there is a way to get the same functionality in clap v3.

So they moved it away from ArgMatches and I need to use Command::render_usage instead.

Yes, though I think the intended/better imo API is write_help (playground) now.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.