Hide benchmarking CLI behind the feature flag (#5600)

* Hide benchmarking CLI behind the feature flag

* Add a message
This commit is contained in:
Stanislav Tkach authored and GitHub committed 2020-04-09 18:50:47 +02:00
1 parent ac9a852028
commit effc9bae92
2 files changed
+12 -3

No files matched your search

+8 -2
View File
@@ -80,9 +80,15 @@ pub fn run() -> Result<()> {
runner.sync_run(|config| cmd.run::<Block, RuntimeApi, Executor>(config))
}
Some(Subcommand::Benchmark(cmd)) => {
let runner = cli.create_runner(cmd)?;
if cfg!(feature = "runtime-benchmarks") {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| cmd.run::<Block, Executor>(config))
runner.sync_run(|config| cmd.run::<Block, Executor>(config))
} else {
println!("Benchmarking wasn't enabled when building the node. \
You can enable it with `--features runtime-benchmarks`.");
Ok(())
}
}
Some(Subcommand::Factory(cmd)) => {
let runner = cli.create_runner(cmd)?;