annotate rust/rhg/src/commands.rs @ 45367:53af26aa5951

rhg: handle broken pipe error for stderr Differential Revision: https://phab.mercurial-scm.org/D8871
author Antoine Cezar <antoine.cezar@octobus.net>
date Fri, 24 Jul 2020 10:34:04 +0200
parents 5fe25f8ef5d9
children ed95ccc94333
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
45364
5fe25f8ef5d9 rhg: add a `Files` `Command` to prepare the `rhg files` subcommand
Antoine Cezar <antoine.cezar@octobus.net>
parents: 45361
diff changeset
1 pub mod files;
45049
513b3ef277a3 rhg: add RootCommand using hg-core FindRoot operation to prepare `hg root`
Antoine Cezar <antoine.cezar@octobus.net>
parents: 44982
diff changeset
2 pub mod root;
44982
bacf6c7ef01b rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
3 use crate::error::CommandError;
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 /// 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
6 ///
bacf6c7ef01b rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
7 /// Normalize the interface of the commands provided by rhg
45361
47997afadf08 rhg: ask the error message from `CommandError`
Antoine Cezar <antoine.cezar@octobus.net>
parents: 45049
diff changeset
8 pub trait Command<'a> {
44982
bacf6c7ef01b rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
9 fn run(&self) -> Result<(), CommandError>;
bacf6c7ef01b rhg: add Command trait for subcommands implemented by rhg
Antoine Cezar <antoine.cezar@octobus.net>
parents:
diff changeset
10 }