1use clap::{Parser, Subcommand};
2use foundry_cli::opts::{BuildOpts, EvmArgs, GlobalArgs};
3use foundry_common::version::{LONG_VERSION, SHORT_VERSION};
4use std::path::PathBuf;
5
6foundry_config::impl_figment_convert!(Chisel, build, evm);
7
8#[derive(Debug, Parser)]
10#[command(name = "chisel", version = SHORT_VERSION, long_version = LONG_VERSION)]
11pub struct Chisel {
12 #[command(flatten)]
14 pub global: GlobalArgs,
15
16 #[command(subcommand)]
17 pub cmd: Option<ChiselSubcommand>,
18
19 #[arg(long, help_heading = "REPL options")]
24 pub prelude: Option<PathBuf>,
25
26 #[arg(long, help_heading = "REPL options", long_help = format!(
28 "Disable the default `Vm` import.\n\n\
29 The import is disabled by default if the Solc version is less than {}.",
30 crate::source::MIN_VM_VERSION
31 ))]
32 pub no_vm: bool,
33
34 #[arg(long, help_heading = "REPL options")]
39 pub ir_minimum: bool,
40
41 #[command(flatten)]
42 pub build: BuildOpts,
43
44 #[command(flatten)]
45 pub evm: EvmArgs,
46}
47
48#[derive(Debug, Subcommand)]
50pub enum ChiselSubcommand {
51 List,
53
54 Load {
56 id: String,
58 },
59
60 View {
62 id: String,
64 },
65
66 ClearCache,
68
69 Eval {
71 command: String,
73 },
74}