diff --git a/src/cli/decode.rs b/src/cli/decode.rs index d60c989c..8eabf0ff 100644 --- a/src/cli/decode.rs +++ b/src/cli/decode.rs @@ -115,6 +115,11 @@ macro_rules! run_x { } impl Cmd { + /// Run the CLIs decode command. + /// + /// ## Errors + /// + /// If the command is configured with state that is invalid. pub fn run(&self, channel: &Channel) -> Result<(), Error> { match channel { Channel::Curr => self.run_curr()?, diff --git a/src/cli/encode.rs b/src/cli/encode.rs index ba588790..07da4b07 100644 --- a/src/cli/encode.rs +++ b/src/cli/encode.rs @@ -131,6 +131,11 @@ macro_rules! run_x { } impl Cmd { + /// Run the CLIs encode command. + /// + /// ## Errors + /// + /// If the command is configured with state that is invalid. pub fn run(&self, channel: &Channel) -> Result<(), Error> { match channel { Channel::Curr => self.run_curr()?, diff --git a/src/cli/guess.rs b/src/cli/guess.rs index 4f48820b..5212fc04 100644 --- a/src/cli/guess.rs +++ b/src/cli/guess.rs @@ -128,6 +128,11 @@ macro_rules! run_x { } impl Cmd { + /// Run the CLIs guess command. + /// + /// ## Errors + /// + /// If the command is configured with state that is invalid. pub fn run(&self, channel: &Channel) -> Result<(), Error> { match channel { Channel::Curr => self.run_curr()?, diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 9db33de0..68dd0fb6 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -1,7 +1,7 @@ -mod decode; -mod encode; -mod guess; -mod types; +pub mod decode; +pub mod encode; +pub mod guess; +pub mod types; mod version; use clap::{Parser, Subcommand, ValueEnum}; diff --git a/src/cli/types.rs b/src/cli/types.rs index 893a4c75..e9a24715 100644 --- a/src/cli/types.rs +++ b/src/cli/types.rs @@ -1,4 +1,4 @@ -mod list; +pub mod list; mod schema; use clap::{Args, Subcommand}; @@ -19,12 +19,21 @@ pub struct Cmd { } #[derive(Subcommand, Clone, Debug)] -pub enum Sub { +enum Sub { List(list::Cmd), Schema(schema::Cmd), } impl Cmd { + /// Run the CLIs types command. + /// + /// ## Errors + /// + /// If the sub-command panics. + /// + /// ## Panics + /// + /// If the sub-command panics. pub fn run(&self, channel: &Channel) -> Result<(), Error> { match &self.sub { Sub::List(c) => c.run(channel), diff --git a/src/cli/types/list.rs b/src/cli/types/list.rs index 30054ac4..a5641e0c 100644 --- a/src/cli/types/list.rs +++ b/src/cli/types/list.rs @@ -24,6 +24,11 @@ impl Default for OutputFormat { } impl Cmd { + /// Run the CLIs types list command. + /// + /// ## Panics + /// + /// If the list cannot be rendered as JSON. pub fn run(&self, channel: &Channel) { let types = Self::types(channel); match self.output {