mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 00:54:56 +02:00
Remove --encoding
argument during register plugin (#6486)
* first implement new plugin protocol core logic * fix debug body construct * fix output message from plugin * finish plugin commands calling * fix tests and adjust plugin_custom_value call * fmt code * fmt code, fix clippy * add FIXME comment * change from FIXME to TODO
This commit is contained in:
@ -57,9 +57,8 @@ pub trait Command: Send + Sync + CommandClone {
|
||||
false
|
||||
}
|
||||
|
||||
// Is a plugin command (returns plugin's path, encoding and type of shell
|
||||
// if the declaration is a plugin)
|
||||
fn is_plugin(&self) -> Option<(&PathBuf, &str, &Option<PathBuf>)> {
|
||||
// Is a plugin command (returns plugin's path, type of shell if the declaration is a plugin)
|
||||
fn is_plugin(&self) -> Option<(&PathBuf, &Option<PathBuf>)> {
|
||||
None
|
||||
}
|
||||
|
||||
|
@ -366,8 +366,7 @@ impl EngineState {
|
||||
self.plugin_decls().try_for_each(|decl| {
|
||||
// A successful plugin registration already includes the plugin filename
|
||||
// No need to check the None option
|
||||
let (path, encoding, shell) =
|
||||
decl.is_plugin().expect("plugin should have file name");
|
||||
let (path, shell) = decl.is_plugin().expect("plugin should have file name");
|
||||
let mut file_name = path
|
||||
.to_str()
|
||||
.expect("path was checked during registration as a str")
|
||||
@ -394,14 +393,10 @@ impl EngineState {
|
||||
None => "".into(),
|
||||
};
|
||||
|
||||
// Each signature is stored in the plugin file with the required
|
||||
// encoding, shell and signature
|
||||
// Each signature is stored in the plugin file with the shell and signature
|
||||
// This information will be used when loading the plugin
|
||||
// information when nushell starts
|
||||
format!(
|
||||
"register {} -e {} {} {}\n\n",
|
||||
file_name, encoding, shell_str, signature
|
||||
)
|
||||
format!("register {} {} {}\n\n", file_name, shell_str, signature)
|
||||
})
|
||||
.map_err(|err| ShellError::PluginFailedToLoad(err.to_string()))
|
||||
.and_then(|line| {
|
||||
|
Reference in New Issue
Block a user