plugin command

This commit is contained in:
Fernando Herrera
2021-10-23 21:08:54 +01:00
parent 1c52919103
commit 232790f488
8 changed files with 239 additions and 0 deletions

View File

@ -56,6 +56,7 @@ pub fn create_default_context() -> Rc<RefCell<EngineState>> {
Mv,
Ps,
Rm,
RunPlugin,
Select,
Size,
Split,

View File

@ -1,7 +1,9 @@
mod git;
mod git_checkout;
mod list_git_branches;
mod run_plugin;
pub use git::Git;
pub use git_checkout::GitCheckout;
pub use list_git_branches::ListGitBranches;
pub use run_plugin::RunPlugin;

View File

@ -0,0 +1,28 @@
use nu_protocol::ast::Call;
use nu_protocol::engine::{Command, EvaluationContext};
use nu_protocol::{ShellError, Signature, Value};
pub struct RunPlugin;
impl Command for RunPlugin {
fn name(&self) -> &str {
"run_plugin"
}
fn usage(&self) -> &str {
"test for plugin encoding"
}
fn signature(&self) -> nu_protocol::Signature {
Signature::build("run_plugin")
}
fn run(
&self,
_context: &EvaluationContext,
_call: &Call,
_input: Value,
) -> Result<nu_protocol::Value, ShellError> {
Err(ShellError::InternalError("plugin".into()))
}
}