Mercurial > public > mercurial-scm > hg
comparison rust/rhg/src/commands/files.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 |
comparison
equal
deleted
inserted
replaced
46500:184e46550dc8 | 46501:1ecaf09d9964 |
---|---|
1 use crate::error::CommandError; | 1 use crate::error::CommandError; |
2 use crate::ui::Ui; | 2 use crate::ui::Ui; |
3 use clap::Arg; | |
3 use clap::ArgMatches; | 4 use clap::ArgMatches; |
4 use hg::config::Config; | 5 use hg::config::Config; |
5 use hg::operations::list_rev_tracked_files; | 6 use hg::operations::list_rev_tracked_files; |
6 use hg::operations::Dirstate; | 7 use hg::operations::Dirstate; |
7 use hg::repo::Repo; | 8 use hg::repo::Repo; |
11 pub const HELP_TEXT: &str = " | 12 pub const HELP_TEXT: &str = " |
12 List tracked files. | 13 List tracked files. |
13 | 14 |
14 Returns 0 on success. | 15 Returns 0 on success. |
15 "; | 16 "; |
17 | |
18 pub fn args() -> clap::App<'static, 'static> { | |
19 clap::SubCommand::with_name("files") | |
20 .arg( | |
21 Arg::with_name("rev") | |
22 .help("search the repository as it is in REV") | |
23 .short("-r") | |
24 .long("--revision") | |
25 .value_name("REV") | |
26 .takes_value(true), | |
27 ) | |
28 .about(HELP_TEXT) | |
29 } | |
16 | 30 |
17 pub fn run( | 31 pub fn run( |
18 ui: &Ui, | 32 ui: &Ui, |
19 config: &Config, | 33 config: &Config, |
20 args: &ArgMatches, | 34 args: &ArgMatches, |