Skip to content

Commit

Permalink
feat: nsv command config/list
Browse files Browse the repository at this point in the history
add command config/list. use config/list command print to nsv config foramt to terminal
  • Loading branch information
1739616529 committed Aug 9, 2024
1 parent eb2a017 commit 088af3c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions crates/nsv/src/command/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ impl Command for Config {
ConfigSubCommand::Get(get) => {
get.apply(core).await?;
}
ConfigSubCommand::List(get) => {
get.apply(core).await?;
}
}
Ok(())
}
Expand All @@ -36,6 +39,8 @@ pub enum ConfigSubCommand {
Set(ConfigSubSet),
#[clap(name = "get", bin_name = "get")]
Get(ConfigSubGet),
#[clap(name = "list", bin_name = "list")]
List(ConfigSubList),
}


Expand Down Expand Up @@ -70,3 +75,16 @@ impl Command for ConfigSubGet {
Ok(())
}
}


#[derive(clap::Parser, Debug)]
pub struct ConfigSubList {
}

#[async_trait]
impl Command for ConfigSubList {
async fn apply(&self, core: &mut NsvCore) -> Result<(), NsvCoreError>{
print_log_info!("config list: \n{}", &core.config);
Ok(())
}
}

0 comments on commit 088af3c

Please sign in to comment.