Shared params in CLI API (#4466)

* Common shared parames getter

* Expose more types from `service-builder`

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Arkadiy Paronyan
2019-12-20 16:05:01 +01:00
committed by Bastian Köcher
parent bfad5f3ffc
commit 9950ea98fc
6 changed files with 47 additions and 69 deletions
+5 -4
View File
@@ -15,6 +15,7 @@
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
use structopt::{StructOpt, clap::App};
use crate::params::SharedParams;
/// Something that can augment a clap app with further parameters.
/// `derive(StructOpt)` is implementing this function by default, so a macro `impl_augment_clap!`
@@ -37,8 +38,8 @@ macro_rules! impl_augment_clap {
}
}
/// Returns the log filter given by the user as commandline argument.
pub trait GetLogFilter {
/// Returns the set log filter.
fn get_log_filter(&self) -> Option<String>;
/// Supports getting common params.
pub trait GetSharedParams {
/// Returns shared params if any.
fn shared_params(&self) -> Option<&SharedParams>;
}