Mercurial > hg
annotate rust/rhg/src/commands.rs @ 44982:bacf6c7ef01b
rhg: add Command trait for subcommands implemented by rhg
Normalizes the interface of the cli's commands
Differential Revision: https://phab.mercurial-scm.org/D8611
Differential Revision: https://phab.mercurial-scm.org/D8648
author | Antoine Cezar <antoine.cezar@octobus.net> |
---|---|
date | Mon, 22 Jun 2020 15:19:35 +0530 |
parents | |
children | 513b3ef277a3 |
rev | line source |
---|---|
44982
bacf6c7ef01b
rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff
changeset
|
1 use crate::error::CommandError; |
bacf6c7ef01b
rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff
changeset
|
2 |
bacf6c7ef01b
rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff
changeset
|
3 /// The common trait for rhg commands |
bacf6c7ef01b
rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff
changeset
|
4 /// |
bacf6c7ef01b
rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff
changeset
|
5 /// Normalize the interface of the commands provided by rhg |
bacf6c7ef01b
rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff
changeset
|
6 pub trait Command { |
bacf6c7ef01b
rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff
changeset
|
7 fn run(&self) -> Result<(), CommandError>; |
bacf6c7ef01b
rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff
changeset
|
8 } |