From 5bba6e8b82a0bdb3b0e3f5fefdd25e019ec7f0d2 Mon Sep 17 00:00:00 2001 From: prplV Date: Tue, 10 Dec 2024 13:48:56 +0300 Subject: [PATCH] added with-flags param to start/restart cmd --- noxis-cli/src/cli.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/noxis-cli/src/cli.rs b/noxis-cli/src/cli.rs index f8e0dd6..f887a4e 100644 --- a/noxis-cli/src/cli.rs +++ b/noxis-cli/src/cli.rs @@ -1,3 +1,5 @@ +use std::string; + use clap::{Parser, Subcommand}; #[derive(Debug, Parser)] @@ -17,7 +19,7 @@ pub enum Commands { #[command( about = "To start Noxis process", )] - Start, + Start(StartAction), #[command( about = "To stop Noxis process", )] @@ -25,7 +27,7 @@ pub enum Commands { #[command( about = "To restart Noxis process", )] - Restart, + Restart(StartAction), #[command( about = "To get list of processes that are being monitoring", )] @@ -42,6 +44,16 @@ pub enum Commands { Config(ConfigCommand), } +#[derive(Debug, Parser)] +pub struct StartAction { + #[arg( + long="with-flags", + num_args = 1.., + value_delimiter = ' ' + )] + flags : Vec, +} + #[derive(Debug, Parser)] pub struct ConfigCommand { #[command(subcommand)]