WIP now load plugins automatically

This commit is contained in:
Jonathan Turner
2019-07-04 05:37:09 +12:00
parent 75ddfe9f5a
commit 0180769971
25 changed files with 348 additions and 329 deletions

View File

@ -3,9 +3,7 @@ use serde::{Deserialize, Serialize};
use std::io;
pub trait Plugin {
fn config(&mut self) -> Result<CommandConfig, ShellError> {
Err(ShellError::string("`config` not implemented in plugin"))
}
fn config(&mut self) -> Result<CommandConfig, ShellError>;
#[allow(unused)]
fn begin_filter(&mut self, args: Args) -> Result<(), ShellError> {
Err(ShellError::string(
@ -50,8 +48,8 @@ pub fn serve_plugin(plugin: &mut dyn Plugin) {
}
e => {
send_response(ShellError::string(format!(
"Could not handle plugin message: {:?}",
e,
"Could not handle plugin message: {} {:?}",
input, e
)));
break;
}