Mercurial > public > mercurial-scm > hg-stable
diff rust/rhg/src/commands/cat.rs @ 46553: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/cat.rs Mon Feb 08 20:33:04 2021 +0100 +++ b/rust/rhg/src/commands/cat.rs Mon Feb 08 21:05:36 2021 +0100 @@ -1,5 +1,6 @@ use crate::error::CommandError; use crate::ui::Ui; +use clap::Arg; use clap::ArgMatches; use hg::config::Config; use hg::operations::cat; @@ -12,6 +13,27 @@ Output the current or given revision of files "; +pub fn args() -> clap::App<'static, 'static> { + clap::SubCommand::with_name("cat") + .arg( + Arg::with_name("rev") + .help("search the repository as it is in REV") + .short("-r") + .long("--revision") + .value_name("REV") + .takes_value(true), + ) + .arg( + clap::Arg::with_name("files") + .required(true) + .multiple(true) + .empty_values(false) + .value_name("FILE") + .help("Activity to start: activity@category"), + ) + .about(HELP_TEXT) +} + #[timed] pub fn run( ui: &Ui,