Cli tool tests (#977)

* add tests and fix some minor things

* implement output writer and some tests

* formatting

* adjust tests and formatting

* clippy fix

* cargo fmt

* revert change in substrate runner

* clippy suggestions

* mode make_type to test mod
This commit is contained in:
Tadeo Hepperle
2023-06-14 10:52:31 +02:00
committed by GitHub
parent a62d6a400e
commit 3cfe91e3be
11 changed files with 228 additions and 116 deletions
+7 -6
View File
@@ -6,6 +6,7 @@
mod commands;
mod utils;
use clap::Parser as ClapParser;
/// Subxt utilities for interacting with Substrate based nodes.
@@ -22,12 +23,12 @@ enum Command {
async fn main() -> color_eyre::Result<()> {
color_eyre::install()?;
let args = Command::parse();
let mut output = std::io::stdout();
match args {
Command::Metadata(opts) => commands::metadata::run(opts).await,
Command::Codegen(opts) => commands::codegen::run(opts).await,
Command::Compatibility(opts) => commands::compatibility::run(opts).await,
Command::Version(opts) => commands::version::run(opts),
Command::Explore(opts) => commands::explore::run(opts).await,
Command::Metadata(opts) => commands::metadata::run(opts, &mut output).await,
Command::Codegen(opts) => commands::codegen::run(opts, &mut output).await,
Command::Compatibility(opts) => commands::compatibility::run(opts, &mut output).await,
Command::Version(opts) => commands::version::run(opts, &mut output),
Command::Explore(opts) => commands::explore::run(opts, &mut output).await,
}
}