Skip to content

Commit

Permalink
rename interpret to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebenfield committed Nov 18, 2024
1 parent 8f6d58f commit 01f3127
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions leo/cli/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ enum Commands {
#[clap(flatten)]
command: LeoBuild,
},
#[clap(about = "Interpret the current package")]
Interpret {
#[clap(about = "Debug the current package via the interpreter")]
Debug {
#[clap(flatten)]
command: LeoInterpret,
command: LeoDebug,
},
#[clap(about = "Add a new on-chain or local dependency to the current package.")]
Add {
Expand Down Expand Up @@ -138,7 +138,7 @@ pub fn run_with_args(cli: CLI) -> Result<()> {
Commands::Account { command } => command.try_execute(context),
Commands::New { command } => command.try_execute(context),
Commands::Build { command } => command.try_execute(context),
Commands::Interpret { command } => command.try_execute(context),
Commands::Debug { command } => command.try_execute(context),
Commands::Query { command } => command.try_execute(context),
Commands::Clean { command } => command.try_execute(context),
Commands::Deploy { command } => command.try_execute(context),
Expand Down
14 changes: 7 additions & 7 deletions leo/cli/commands/interpret.rs → leo/cli/commands/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ use leo_span::Symbol;

use super::*;

/// Interprets an Aleo program.
/// Debugs an Aleo program through the interpreter.
#[derive(Parser, Debug)]
pub struct LeoInterpret {
pub struct LeoDebug {
#[clap(flatten)]
pub(crate) compiler_options: BuildOptions,
}

impl Command for LeoInterpret {
impl Command for LeoDebug {
type Input = <LeoBuild as Command>::Output;
type Output = ();

Expand All @@ -50,24 +50,24 @@ impl Command for LeoInterpret {
// Parse the network.
let network = NetworkName::try_from(context.get_network(&self.compiler_options.network)?)?;
match network {
NetworkName::TestnetV0 => handle_interpret::<TestnetV0>(&self, context),
NetworkName::TestnetV0 => handle_debug::<TestnetV0>(&self, context),
NetworkName::MainnetV0 => {
#[cfg(feature = "only_testnet")]
panic!("Mainnet chosen with only_testnet feature");
#[cfg(not(feature = "only_testnet"))]
return handle_interpret::<MainnetV0>(&self, context);
return handle_debug::<MainnetV0>(&self, context);
}
NetworkName::CanaryV0 => {
#[cfg(feature = "only_testnet")]
panic!("Canary chosen with only_testnet feature");
#[cfg(not(feature = "only_testnet"))]
return handle_interpret::<CanaryV0>(&self, context);
return handle_debug::<CanaryV0>(&self, context);
}
}
}
}

fn handle_interpret<N: Network>(command: &LeoInterpret, context: Context) -> Result<()> {
fn handle_debug<N: Network>(command: &LeoDebug, context: Context) -> Result<()> {
// Get the package path.
let package_path = context.dir()?;
let home_path = context.home()?;
Expand Down
6 changes: 3 additions & 3 deletions leo/cli/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ pub use build::LeoBuild;
pub mod clean;
pub use clean::LeoClean;

pub mod debug;
pub use debug::LeoDebug;

pub mod deploy;
pub use deploy::Deploy;

Expand All @@ -35,9 +38,6 @@ pub use example::LeoExample;
pub mod execute;
pub use execute::LeoExecute;

pub mod interpret;
pub use interpret::LeoInterpret;

pub mod query;
pub use query::LeoQuery;

Expand Down

0 comments on commit 01f3127

Please sign in to comment.