Skip to content

Commit 5a88187

Browse files
committed
add out arg
1 parent bc2b4fd commit 5a88187

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

crates/forge/bin/cmd/bind_json.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::eip712::Resolver;
2-
use clap::Parser;
2+
use clap::{Parser, ValueHint};
33
use eyre::{Ok, Result};
44
use foundry_cli::{opts::CoreBuildArgs, utils::LoadConfig};
55
use foundry_common::{compile::with_compilation_reporter, fs};
@@ -28,6 +28,10 @@ foundry_config::impl_figment_convert!(BindJsonArgs, opts);
2828
/// CLI arguments for `forge bind-json`.
2929
#[derive(Clone, Debug, Parser)]
3030
pub struct BindJsonArgs {
31+
/// The path to write bindings to.
32+
#[arg(value_hint = ValueHint::FilePath, value_name = "PATH")]
33+
pub out: Option<PathBuf>,
34+
3135
#[command(flatten)]
3236
opts: CoreBuildArgs,
3337
}
@@ -58,7 +62,7 @@ impl BindJsonArgs {
5862
let config = self.try_load_config_emit_warnings()?;
5963
let project = config.create_project(false, true)?;
6064

61-
let target_path = config.root.0.join(&config.bind_json.out);
65+
let target_path = config.root.0.join(self.out.as_ref().unwrap_or(&config.bind_json.out));
6266

6367
let sources = project.paths.read_input_files()?;
6468
let graph = Graph::<MultiCompilerParsedSource>::resolve_sources(&project.paths, sources)?;

0 commit comments

Comments
 (0)