Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make fields of CLI commands pub #403

Merged
merged 4 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading