mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Back to working state
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user