1 use crate::command_prelude::*; 2 3 use std::collections::HashMap; 4 use std::process; 5 cli() -> App6pub fn cli() -> App { 7 subcommand("verify-project") 8 .about("Check correctness of crate manifest") 9 .arg(opt("quiet", "No output printed to stdout").short("q")) 10 .arg_manifest_path() 11 .after_help("Run `cargo help verify-project` for more detailed information.\n") 12 } 13 exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult14pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult { 15 if let Err(e) = args.workspace(config) { 16 let mut h = HashMap::new(); 17 h.insert("invalid".to_string(), e.to_string()); 18 config.shell().print_json(&h)?; 19 process::exit(1) 20 } 21 22 let mut h = HashMap::new(); 23 h.insert("success".to_string(), "true".to_string()); 24 config.shell().print_json(&h)?; 25 Ok(()) 26 } 27