Mercurial > public > mercurial-scm > hg
comparison rust/rhg/src/commands/root.rs @ 49640:37bc3edef76f
rhg: upgrade `clap` dependency
This one is the worst one to upgrade since v2 -> v4 broke a ton of API,
which thankfully seems saner now.
Contrary to what was done in the `hg-core/src/examples/nodemap` rewrite,
we're not switching from the "builder" pattern to the "derive" pattern,
since that would imply a much larger diff. It can be done incrementally.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Tue, 15 Nov 2022 00:02:43 +0100 |
parents | 97ac588b6d9e |
children | 532e74ad3ff6 |
comparison
equal
deleted
inserted
replaced
49639:5844cd8e81ca | 49640:37bc3edef76f |
---|---|
7 Print the root directory of the current repository. | 7 Print the root directory of the current repository. |
8 | 8 |
9 Returns 0 on success. | 9 Returns 0 on success. |
10 "; | 10 "; |
11 | 11 |
12 pub fn args() -> clap::App<'static, 'static> { | 12 pub fn args() -> clap::Command { |
13 clap::SubCommand::with_name("root").about(HELP_TEXT) | 13 clap::command!("root").about(HELP_TEXT) |
14 } | 14 } |
15 | 15 |
16 pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> { | 16 pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> { |
17 let repo = invocation.repo?; | 17 let repo = invocation.repo?; |
18 let working_directory = repo.working_directory_path(); | 18 let working_directory = repo.working_directory_path(); |