Skip to content
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#### Upcoming Changes

* refactor: Clap attribute macros from #[clap(...)] to #[arg(...)] and #[command(...)] in v4.x [#2003] (https://github.com/lambdaclass/cairo-vm/pull/2003)

* fix: Fix `WriteReturnFp` error due to a bad loading of initial gas [#2015](https://github.com/lambdaclass/cairo-vm/pull/2015)

* refactor: Replaces security anyhow errors with enum variants [#1946](https://github.com/lambdaclass/cairo-vm/pull/1946)
Expand Down
36 changes: 18 additions & 18 deletions cairo-vm-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,51 +32,51 @@ use mimalloc::MiMalloc;
static ALLOC: MiMalloc = MiMalloc;

#[derive(Parser, Debug)]
#[clap(author, version, about, long_about = None)]
#[command(author, version, about, long_about = None)]
struct Args {
#[clap(value_parser, value_hint=ValueHint::FilePath)]
#[arg(value_parser, value_hint=ValueHint::FilePath)]
filename: PathBuf,
#[clap(long = "trace_file", value_parser)]
#[arg(long = "trace_file", value_parser)]
trace_file: Option<PathBuf>,
#[structopt(long = "print_output")]
#[arg(long = "print_output")]
print_output: bool,
#[structopt(long = "entrypoint", default_value = "main")]
#[arg(long = "entrypoint", default_value = "main")]
entrypoint: String,
#[structopt(long = "memory_file")]
#[arg(long = "memory_file")]
memory_file: Option<PathBuf>,
/// When using dynamic layout, it's parameters must be specified through a layout params file.
#[clap(long = "layout", default_value = "plain", value_enum)]
/// When using dynamic layout, its parameters must be specified through a layout params file.
#[arg(long = "layout", default_value = "plain", value_enum)]
layout: LayoutName,
/// Required when using with dynamic layout.
/// Ignored otherwise.
#[clap(long = "cairo_layout_params_file", required_if_eq("layout", "dynamic"))]
#[arg(long = "cairo_layout_params_file", required_if_eq("layout", "dynamic"))]
cairo_layout_params_file: Option<PathBuf>,
#[structopt(long = "proof_mode")]
#[arg(long = "proof_mode")]
proof_mode: bool,
#[structopt(long = "secure_run")]
#[arg(long = "secure_run")]
secure_run: Option<bool>,
#[clap(long = "air_public_input", requires = "proof_mode")]
#[arg(long = "air_public_input", requires = "proof_mode")]
air_public_input: Option<String>,
#[clap(
#[arg(
long = "air_private_input",
requires_all = ["proof_mode", "trace_file", "memory_file"]
)]
air_private_input: Option<String>,
#[clap(
#[arg(
long = "cairo_pie_output",
// We need to add these air_private_input & air_public_input or else
// passing cairo_pie_output + either of these without proof_mode will not fail
conflicts_with_all = ["proof_mode", "air_private_input", "air_public_input"]
)]
cairo_pie_output: Option<String>,
#[structopt(long = "merge_extra_segments")]
#[arg(long = "merge_extra_segments")]
merge_extra_segments: bool,
#[structopt(long = "allow_missing_builtins")]
#[arg(long = "allow_missing_builtins")]
allow_missing_builtins: Option<bool>,
#[structopt(long = "tracer")]
#[arg(long = "tracer")]
#[cfg(feature = "with_tracer")]
tracer: bool,
#[structopt(
#[arg(
long = "run_from_cairo_pie",
// We need to add these air_private_input & air_public_input or else
// passing run_from_cairo_pie + either of these without proof_mode will not fail
Expand Down
32 changes: 16 additions & 16 deletions cairo1-run/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,49 +17,49 @@ use std::{
};

#[derive(Parser, Debug)]
#[clap(author, version, about, long_about = None)]
#[command(author, version, about, long_about = None)]
struct Args {
#[clap(value_parser, value_hint=ValueHint::FilePath)]
#[arg(value_parser, value_hint=ValueHint::FilePath)]
filename: PathBuf,
#[clap(long = "trace_file", value_parser)]
#[arg(long = "trace_file", value_parser)]
trace_file: Option<PathBuf>,
#[structopt(long = "memory_file")]
#[arg(long = "memory_file")]
memory_file: Option<PathBuf>,
/// When using dynamic layout, it's parameters must be specified through a layout params file.
#[clap(long = "layout", default_value = "plain", value_enum)]
/// When using dynamic layout, its parameters must be specified through a layout params file.
#[arg(long = "layout", default_value = "plain", value_enum)]
layout: LayoutName,
/// Required when using with dynamic layout.
/// Ignored otherwise.
#[clap(long = "cairo_layout_params_file", required_if_eq("layout", "dynamic"))]
#[arg(long = "cairo_layout_params_file", required_if_eq("layout", "dynamic"))]
cairo_layout_params_file: Option<PathBuf>,
#[clap(long = "proof_mode", value_parser)]
#[arg(long = "proof_mode", value_parser)]
proof_mode: bool,
#[clap(long = "air_public_input", requires = "proof_mode")]
#[arg(long = "air_public_input", requires = "proof_mode")]
air_public_input: Option<PathBuf>,
#[clap(
#[arg(
long = "air_private_input",
requires_all = ["proof_mode", "trace_file", "memory_file"]
)]
air_private_input: Option<PathBuf>,
#[clap(
#[arg(
long = "cairo_pie_output",
// We need to add these air_private_input & air_public_input or else
// passing cairo_pie_output + either of these without proof_mode will not fail
conflicts_with_all = ["proof_mode", "air_private_input", "air_public_input"]
)]
cairo_pie_output: Option<PathBuf>,
#[clap(long = "merge_extra_segments", value_parser)]
#[arg(long = "merge_extra_segments", value_parser)]
merge_extra_segments: bool,
// Arguments should be spaced, with array elements placed between brackets
// For example " --args '1 2 [1 2 3]'" will yield 3 arguments, with the last one being an array of 3 elements
#[clap(long = "args", default_value = "", value_parser=process_args, conflicts_with = "args_file")]
#[arg(long = "args", default_value = "", value_parser=process_args, conflicts_with = "args_file")]
args: FuncArgs,
// Same rules from `args` apply here
#[clap(long = "args_file", value_parser, value_hint=ValueHint::FilePath, conflicts_with = "args")]
#[arg(long = "args_file", value_parser, value_hint=ValueHint::FilePath, conflicts_with = "args")]
args_file: Option<PathBuf>,
#[clap(long = "print_output", value_parser)]
#[arg(long = "print_output", value_parser)]
print_output: bool,
#[clap(
#[arg(
long = "append_return_values",
// We need to add these air_private_input & air_public_input or else
// passing cairo_pie_output + either of these without proof_mode will not fail
Expand Down
1 change: 1 addition & 0 deletions corelib
Loading