From 3659d1f54c385a58c31569bf288bbb66efd81d53 Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Mon, 1 Jul 2024 15:45:00 -0700 Subject: [PATCH] usability enhancements --- leo/cli/commands/execute.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/leo/cli/commands/execute.rs b/leo/cli/commands/execute.rs index ce07e70153..cee8dc6e84 100644 --- a/leo/cli/commands/execute.rs +++ b/leo/cli/commands/execute.rs @@ -67,6 +67,8 @@ pub struct Execute { compiler_options: BuildOptions, #[arg(short, long, help = "The inputs to the program, from a file. Overrides the INPUTS argument.")] file: Option, + #[clap(long, help = "Disables building of the project before execution.", default_value = "false")] + pub(crate) no_build: bool, } impl Command for Execute { @@ -79,7 +81,7 @@ impl Command for Execute { fn prelude(&self, context: Context) -> Result { // No need to build if we are executing an external program. - if self.program.is_some() { + if self.program.is_some() || self.no_build { return Ok(()); } (Build { options: self.compiler_options.clone() }).execute(context) @@ -148,7 +150,7 @@ fn handle_execute( // Get the program name. let program_name = match (command.program.clone(), command.local) { (Some(name), true) => { - let local = context.open_manifest::()?.program_id().to_string(); + let local = context.open_manifest::()?.program_id().name().to_string(); // Throw error if local name doesn't match the specified name. if name == local { local @@ -157,7 +159,7 @@ fn handle_execute( } } (Some(name), false) => name.clone(), - (None, true) => context.open_manifest::()?.program_id().to_string(), + (None, true) => context.open_manifest::()?.program_id().name().to_string(), (None, false) => return Err(PackageError::missing_on_chain_program_name().into()), };