Skip to content

Commit

Permalink
Make fields of CLI commands pub
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch committed Dec 10, 2024
1 parent 7150033 commit 668d123
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 200 deletions.
334 changes: 155 additions & 179 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ crate-git-revision = "0.0.6"
stellar-strkey = { version = "0.0.9", optional = true }
base64 = { version = "0.13.0", optional = true }
serde = { version = "1.0.139", features = ["derive"], optional = true }
serde_with = { version = "3.0.0", optional = true }
serde_with = { version = "3.0.0", optional = true, default-features = false, features = ["macros", "std"] }
escape-bytes = { version = "0.1.1", default-features = false }
hex = { version = "0.4.3", optional = true }
arbitrary = {version = "1.1.3", features = ["derive"], optional = true}
Expand Down
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
2 changes: 1 addition & 1 deletion src/cli/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub enum Error {
#[command()]
pub struct Cmd {
#[command(subcommand)]
sub: Sub,
pub sub: Sub,
}

#[derive(Subcommand, Clone, Debug)]
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 668d123

Please sign in to comment.