Back to working state

This commit is contained in:
JT
2021-09-03 06:21:37 +12:00
parent e1be8f61fc
commit 94687a7603
28 changed files with 170 additions and 116 deletions

View File

@ -1,5 +1,5 @@
use crate::engine::Command;
use crate::BlockId;
use crate::Command;
use crate::SyntaxShape;
use crate::VarId;
@ -314,6 +314,10 @@ impl Command for Predeclaration {
fn usage(&self) -> &str {
&self.signature.usage
}
fn run(&self, _args: crate::engine::CommandArgs) -> Result<crate::Value, crate::ShellError> {
panic!("Internal error: can't run a predeclaration without a body")
}
}
struct BlockCommand {
@ -333,4 +337,12 @@ impl Command for BlockCommand {
fn usage(&self) -> &str {
&self.signature.usage
}
fn run(&self, _args: crate::engine::CommandArgs) -> Result<crate::Value, crate::ShellError> {
panic!("Internal error: can't run custom command with 'run', use block_id");
}
fn get_custom_command(&self) -> Option<BlockId> {
Some(self.block_id)
}
}