pub fn from_matches(m: &ArgMatches) -> Result<Self> {
        let all_deps = m.is_present("all-deps");

        Ok(Self {
            depth: m
                .value_of("depth")
                .map(|depth| usize::from_str(depth).unwrap()),
            dot_file: m.value_of("dot-file").map(|s| s.into()),
            filter: m
                .values_of("filter")
                .map(|deps| deps.map(|dep| dep.into()).collect()),
            include_orphans: m.is_present("include-orphans"),
            include_versions: m.is_present("include-versions"),
            manifest_path: m.value_of("manifest-path").unwrap_or("Cargo.toml").into(),
            subgraph: m
                .values_of("subgraph")
                .map(|deps| deps.map(|dep| dep.into()).collect()),
            subgraph_name: m.value_of("subgraph-name").map(|s| s.into()),

            regular_deps: !m.is_present("no-regular-deps"),
            build_deps: all_deps || m.is_present("build-deps"),
            dev_deps: all_deps || m.is_present("dev-deps"),
            optional_deps: all_deps || m.is_present("optional-deps"),
            transitive_deps: !m.is_present("no-transitive-deps"),
        })
    }
/// Creates a config object from command line arguments.
Creates a config object from command line arguments.
Creates a config object from command line arguments .
pub fn from_matches(m: &ArgMatches) -> Result<Self> {
        let all_deps = m.is_present("all-deps");
        Ok(Self {
            depth: m
                .value_of("depth")
                .map(|depth| usize::from_str(depth).unwrap()),
            dot_file: m.value_of("dot-file").map(|s| s.into()),
            filter: m
                .values_of("filter")
                .map(|deps| deps.map(|dep| dep.into()).collect()),
            include_orphans: m.is_present("include-orphans"),
            include_versions: m.is_present("include-versions"),
            manifest_path: m.value_of("manifest-path").unwrap_or("Cargo.toml").into(),
            subgraph: m
                .values_of("subgraph")
                .map(|deps| deps.map(|dep| dep.into()).collect()),
            subgraph_name: m.value_of("subgraph-name").map(|s| s.into()),
            regular_deps: !m.is_present("no-regular-deps"),
            build_deps: all_deps || m.is_present("build-deps"),
            dev_deps: all_deps || m.is_present("dev-deps"),
            optional_deps: all_deps || m.is_present("optional-deps"),
            transitive_deps: !m.is_present("no-transitive-deps"),
        })
    }
pub fn from_matches ( m : & ArgMatches ) -> Result < Self > { let all_deps = m . is_present ( " " ) ; Ok ( Self { depth : m . value_of ( " " ) . map ( | depth | usize :: from_str ( depth ) . unwrap ( ) ) , dot_file : m . value_of ( " " ) . map ( | s | s . into ( ) ) , filter : m . values_of ( " " ) . map ( | deps | deps . map ( | dep | dep . into ( ) ) . collect ( ) ) , include_orphans : m . is_present ( " " ) , include_versions : m . is_present ( " " ) , manifest_path : m . value_of ( " " ) . unwrap_or ( " " ) . into ( ) , subgraph : m . values_of ( " " ) . map ( | deps | deps . map ( | dep | dep . into ( ) ) . collect ( ) ) , subgraph_name : m . value_of ( " " ) . map ( | s | s . into ( ) ) , regular_deps : ! m . is_present ( " " ) , build_deps : all_deps || m . is_present ( " " ) , dev_deps : all_deps || m . is_present ( " " ) , optional_deps : all_deps || m . is_present ( " " ) , transitive_deps : ! m . is_present ( " " ) , } ) }
Creates a config object from command line arguments.
Creates a config object from command line arguments .
m
&ArgMatches