From d84053956190eb2b1db5ab1571318616248e9b0e Mon Sep 17 00:00:00 2001 From: Gustavo Dias Date: Tue, 30 Apr 2024 17:09:16 -0300 Subject: [PATCH] feat: initial cli structure for supported commansd --- cli/Cargo.toml | 12 ++++++++++++ cli/src/ctl/mod.rs | 8 ++++++++ cli/src/main.rs | 28 ++++++++++++++++++++++++++++ cli/src/worker/mod.rs | 6 ++++++ 4 files changed, 54 insertions(+) create mode 100644 cli/Cargo.toml create mode 100644 cli/src/ctl/mod.rs create mode 100644 cli/src/main.rs create mode 100644 cli/src/worker/mod.rs diff --git a/cli/Cargo.toml b/cli/Cargo.toml new file mode 100644 index 0000000..994ca77 --- /dev/null +++ b/cli/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "cli" +version.workspace = true +edition.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lints] +workspace = true + +[dependencies] +clap.workspace = true diff --git a/cli/src/ctl/mod.rs b/cli/src/ctl/mod.rs new file mode 100644 index 0000000..be2e768 --- /dev/null +++ b/cli/src/ctl/mod.rs @@ -0,0 +1,8 @@ +use clap::Subcommand; + +#[derive(Debug, Subcommand)] +pub enum Cmd { + Node, + Service, + Deploy, +} diff --git a/cli/src/main.rs b/cli/src/main.rs new file mode 100644 index 0000000..d8f5c51 --- /dev/null +++ b/cli/src/main.rs @@ -0,0 +1,28 @@ +use clap::{Args, Parser, Subcommand}; + +mod ctl; +mod worker; + +#[derive(Debug, Parser)] +struct Cli { + #[command(subcommand)] + cmd: Cmd, +} + +#[derive(Debug, Subcommand)] +enum Cmd { + Ctl(Ctl), + Worker(Worker), +} + +#[derive(Args, Debug)] +struct Ctl { + cmd: ctl::Cmd, +} + +#[derive(Args, Debug)] +struct Worker { + cmd: worker::Cmd, +} + +fn main() {} diff --git a/cli/src/worker/mod.rs b/cli/src/worker/mod.rs new file mode 100644 index 0000000..6936b8d --- /dev/null +++ b/cli/src/worker/mod.rs @@ -0,0 +1,6 @@ +use clap::Subcommand; + +#[derive(Debug, Subcommand)] +pub enum Cmd { + Stop, +}