Skip to content

Commit 752ecf0

Browse files
committed
feat: ffs-client subcommand.
1 parent 5c9d0e6 commit 752ecf0

File tree

6 files changed

+36
-1
lines changed

6 files changed

+36
-1
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protocol/mcr/cli/protocol/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ serde = { workspace = true, features = ["derive"] }
1414
clap = { workspace = true}
1515
dotenv = { workspace = true }
1616
anyhow = { workspace = true }
17+
mcr-protocol-client = { workspace = true }
1718

1819
[lints]
1920
workspace = true

protocol/mcr/cli/protocol/src/cli/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use clap::{Parser, Subcommand};
2+
use mcr_protocol_client::cli::McrProtocolClientSubcommand;
23

34
/// The `mcr-protocol` CLI.
45
#[derive(Parser)]
@@ -13,6 +14,8 @@ pub struct McrProtocol {
1314
#[clap(rename_all = "kebab-case")]
1415
pub enum McrProtocolSubcommand {
1516
Run,
17+
#[clap(subcommand)]
18+
Client(McrProtocolClientSubcommand),
1619
}
1720

1821
/// Implement the `From` trait for `McrProtocol` to convert it into a `McrProtocolSubcommand`.
@@ -38,6 +41,9 @@ impl McrProtocolSubcommand {
3841
McrProtocolSubcommand::Run => {
3942
println!("mcr-protocol is under development. Please check back later.");
4043
}
44+
McrProtocolSubcommand::Client(client) => {
45+
client.execute().await?;
46+
}
4147
}
4248
Ok(())
4349
}

sdk/cli/ffs-client/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ serde = { workspace = true, features = ["derive"] }
1414
clap = { workspace = true}
1515
dotenv = { workspace = true }
1616
anyhow = { workspace = true }
17+
mcr-protocol-client = { workspace = true }
1718

1819
[lints]
1920
workspace = true

sdk/cli/ffs-client/src/cli/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
use clap::Parser;
2+
pub mod protocol;
23

34
#[derive(Parser)]
45
#[clap(rename_all = "kebab-case")]
5-
pub enum FfsClient {}
6+
pub enum FfsClient {
7+
#[clap(subcommand)]
8+
Protocol(protocol::Protocol),
9+
}
610

711
impl FfsClient {
812
pub async fn execute(&self) -> Result<(), anyhow::Error> {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use clap::Subcommand;
2+
use mcr_protocol_client::cli::McrProtocolClientSubcommand;
3+
4+
#[derive(Subcommand)]
5+
#[clap(rename_all = "kebab-case")]
6+
pub enum Protocol {
7+
#[clap(subcommand)]
8+
Mcr(McrProtocolClientSubcommand),
9+
}
10+
11+
impl Protocol {
12+
pub async fn execute(&self) -> Result<(), anyhow::Error> {
13+
match self {
14+
Protocol::Mcr(client) => {
15+
client.execute().await?;
16+
}
17+
}
18+
19+
Ok(())
20+
}
21+
}

0 commit comments

Comments
 (0)