From 43ac519a0b5bf409bca70e5b55d704fd735c803d Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:28:57 +1000 Subject: [PATCH] Make fields of CLI commands pub (#403) * Make fields of CLI commands pub * fix * undo * undo --- src/cli/compare.rs | 8 ++++---- src/cli/decode.rs | 8 ++++---- src/cli/encode.rs | 8 ++++---- src/cli/guess.rs | 8 ++++---- src/cli/types.rs | 4 ++-- src/cli/types/list.rs | 2 +- src/cli/types/schema.rs | 4 ++-- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/cli/compare.rs b/src/cli/compare.rs index 55b195c6..2e68768e 100644 --- a/src/cli/compare.rs +++ b/src/cli/compare.rs @@ -27,19 +27,19 @@ pub enum Error { pub struct Cmd { /// XDR file to decode and compare with the right value #[arg()] - left: PathBuf, + pub left: PathBuf, /// XDR file to decode and compare with the left value #[arg()] - right: PathBuf, + pub right: PathBuf, /// XDR type of both inputs #[arg(long)] - r#type: String, + pub r#type: String, // Input format of the XDR #[arg(long, value_enum, default_value_t)] - input: InputFormat, + pub input: InputFormat, } #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)] diff --git a/src/cli/decode.rs b/src/cli/decode.rs index d0b4d741..5521249c 100644 --- a/src/cli/decode.rs +++ b/src/cli/decode.rs @@ -30,19 +30,19 @@ pub enum Error { pub struct Cmd { /// Files to decode, or stdin if omitted #[arg()] - files: Vec, + pub files: Vec, /// XDR type to decode #[arg(long)] - r#type: String, + pub r#type: String, // Input format of the XDR #[arg(long, value_enum, default_value_t)] - input: InputFormat, + pub input: InputFormat, // Output format #[arg(long, value_enum, default_value_t)] - output: OutputFormat, + pub output: OutputFormat, } #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)] diff --git a/src/cli/encode.rs b/src/cli/encode.rs index b49b3b52..b8892b94 100644 --- a/src/cli/encode.rs +++ b/src/cli/encode.rs @@ -66,19 +66,19 @@ impl From for Error { pub struct Cmd { /// Files to encode, or stdin if omitted #[arg()] - files: Vec, + pub files: Vec, /// XDR type to encode #[arg(long)] - r#type: String, + pub r#type: String, // Input format #[arg(long, value_enum, default_value_t)] - input: InputFormat, + pub input: InputFormat, // Output format to encode to #[arg(long, value_enum, default_value_t)] - output: OutputFormat, + pub output: OutputFormat, } #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)] diff --git a/src/cli/guess.rs b/src/cli/guess.rs index 4623910f..8b94a740 100644 --- a/src/cli/guess.rs +++ b/src/cli/guess.rs @@ -25,19 +25,19 @@ pub enum Error { pub struct Cmd { /// File to decode, or stdin if omitted #[arg()] - file: Option, + pub file: Option, // Input format of the XDR #[arg(long, value_enum, default_value_t)] - input: InputFormat, + pub input: InputFormat, // Output format #[arg(long, value_enum, default_value_t)] - output: OutputFormat, + pub output: OutputFormat, /// Certainty as an arbitrary value #[arg(long, default_value = "2")] - certainty: usize, + pub certainty: usize, } #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)] diff --git a/src/cli/types.rs b/src/cli/types.rs index e9a24715..06ec9bec 100644 --- a/src/cli/types.rs +++ b/src/cli/types.rs @@ -15,11 +15,11 @@ pub enum Error { #[command()] pub struct Cmd { #[command(subcommand)] - sub: Sub, + pub sub: Sub, } #[derive(Subcommand, Clone, Debug)] -enum Sub { +pub enum Sub { List(list::Cmd), Schema(schema::Cmd), } diff --git a/src/cli/types/list.rs b/src/cli/types/list.rs index a5641e0c..c235b20d 100644 --- a/src/cli/types/list.rs +++ b/src/cli/types/list.rs @@ -7,7 +7,7 @@ use crate::cli::Channel; pub struct Cmd { // Output format #[arg(long, value_enum, default_value_t)] - output: OutputFormat, + pub output: OutputFormat, } #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)] diff --git a/src/cli/types/schema.rs b/src/cli/types/schema.rs index 730ca6c0..1dd0eb64 100644 --- a/src/cli/types/schema.rs +++ b/src/cli/types/schema.rs @@ -16,11 +16,11 @@ pub enum Error { pub struct Cmd { /// XDR type to decode #[arg(long)] - r#type: String, + pub r#type: String, // Output format #[arg(long, value_enum, default_value_t)] - output: OutputFormat, + pub output: OutputFormat, } #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, ValueEnum)]