Mercurial > hg
diff rust/rhg/src/commands/debugdata.rs @ 46501:1ecaf09d9964
rhg: Move subcommand CLI arguments definitions to respective modules
Differential Revision: https://phab.mercurial-scm.org/D9968
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Mon, 08 Feb 2021 21:05:36 +0100 |
parents | 184e46550dc8 |
children | d8730ff51d5a |
line wrap: on
line diff
--- a/rust/rhg/src/commands/debugdata.rs Mon Feb 08 20:33:04 2021 +0100 +++ b/rust/rhg/src/commands/debugdata.rs Mon Feb 08 21:05:36 2021 +0100 @@ -1,5 +1,7 @@ use crate::error::CommandError; use crate::ui::Ui; +use clap::Arg; +use clap::ArgGroup; use clap::ArgMatches; use hg::config::Config; use hg::operations::{debug_data, DebugDataKind}; @@ -10,6 +12,34 @@ Dump the contents of a data file revision "; +pub fn args() -> clap::App<'static, 'static> { + clap::SubCommand::with_name("debugdata") + .arg( + Arg::with_name("changelog") + .help("open changelog") + .short("-c") + .long("--changelog"), + ) + .arg( + Arg::with_name("manifest") + .help("open manifest") + .short("-m") + .long("--manifest"), + ) + .group( + ArgGroup::with_name("") + .args(&["changelog", "manifest"]) + .required(true), + ) + .arg( + Arg::with_name("rev") + .help("revision") + .required(true) + .value_name("REV"), + ) + .about(HELP_TEXT) +} + #[timed] pub fn run( ui: &Ui,