chain_spec_generator/
cli.rs1pub(crate) mod commands;
2mod options;
3mod output;
4
5use commands::{run_generate_command, GenerateError};
6
7pub use self::options::CliOptions;
8pub use self::output::CliOutput;
9
10#[derive(Debug, thiserror::Error)]
11pub enum CliError {
12 #[error("{}", .0)]
13 Generate(#[from] GenerateError),
14}
15
16pub fn lib_main(command: CliOptions) -> Result<CliOutput, CliError> {
17 match command {
18 CliOptions::Generate { args } => run_generate_command(args)
19 .map(Into::into)
20 .map_err(Into::into),
21 }
22}