comparison rust/rhg/src/main.rs @ 45923:ead435aa5294

rhg: add a `debugrequirements` subcommand For now it only prints the contents of `.hg/requires` as-is, without parsing. Differential Revision: https://phab.mercurial-scm.org/D9397
author Simon Sapin <simon-commits@exyr.org>
date Tue, 24 Nov 2020 15:11:58 +0100
parents 33ded2d3f4fc
children ca3f73cc3cf4
comparison
equal deleted inserted replaced
45922:37bcd7f5a543 45923:ead435aa5294
81 Arg::with_name("rev") 81 Arg::with_name("rev")
82 .help("revision") 82 .help("revision")
83 .required(true) 83 .required(true)
84 .value_name("REV"), 84 .value_name("REV"),
85 ), 85 ),
86 )
87 .subcommand(
88 SubCommand::with_name("debugrequirements")
89 .about(commands::debugrequirements::HELP_TEXT),
86 ); 90 );
87 91
88 let matches = app.clone().get_matches_safe().unwrap_or_else(|err| { 92 let matches = app.clone().get_matches_safe().unwrap_or_else(|err| {
89 let _ = ui::Ui::new().writeln_stderr_str(&err.message); 93 let _ = ui::Ui::new().writeln_stderr_str(&err.message);
90 std::process::exit(exitcode::UNIMPLEMENTED_COMMAND) 94 std::process::exit(exitcode::UNIMPLEMENTED_COMMAND)
121 ("cat", Some(matches)) => { 125 ("cat", Some(matches)) => {
122 commands::cat::CatCommand::try_from(matches)?.run(&ui) 126 commands::cat::CatCommand::try_from(matches)?.run(&ui)
123 } 127 }
124 ("debugdata", Some(matches)) => { 128 ("debugdata", Some(matches)) => {
125 commands::debugdata::DebugDataCommand::try_from(matches)?.run(&ui) 129 commands::debugdata::DebugDataCommand::try_from(matches)?.run(&ui)
130 }
131 ("debugrequirements", _) => {
132 commands::debugrequirements::DebugRequirementsCommand::new()
133 .run(&ui)
126 } 134 }
127 _ => unreachable!(), // Because of AppSettings::SubcommandRequired, 135 _ => unreachable!(), // Because of AppSettings::SubcommandRequired,
128 } 136 }
129 } 137 }
130 138