Skip to content

Commit

Permalink
Make fields of CLI commands pub (#403)
Browse files Browse the repository at this point in the history
* Make fields of CLI commands pub

* fix

* undo

* undo
  • Loading branch information
leighmcculloch authored Dec 12, 2024
1 parent 7150033 commit 43ac519
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions src/cli/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
8 changes: 4 additions & 4 deletions src/cli/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ pub enum Error {
pub struct Cmd {
/// Files to decode, or stdin if omitted
#[arg()]
files: Vec<PathBuf>,
pub files: Vec<PathBuf>,

/// 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)]
Expand Down
8 changes: 4 additions & 4 deletions src/cli/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ impl From<crate::next::Error> for Error {
pub struct Cmd {
/// Files to encode, or stdin if omitted
#[arg()]
files: Vec<PathBuf>,
pub files: Vec<PathBuf>,

/// 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)]
Expand Down
8 changes: 4 additions & 4 deletions src/cli/guess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ pub enum Error {
pub struct Cmd {
/// File to decode, or stdin if omitted
#[arg()]
file: Option<PathBuf>,
pub file: Option<PathBuf>,

// 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)]
Expand Down
4 changes: 2 additions & 2 deletions src/cli/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down
2 changes: 1 addition & 1 deletion src/cli/types/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
4 changes: 2 additions & 2 deletions src/cli/types/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 43ac519

Please sign in to comment.