mirror of
https://github.com/nushell/nushell
synced 2024-12-26 13:03:07 +00:00
mv -> More organized method definitions.
This commit is contained in:
parent
11095860c8
commit
0f28719564
2 changed files with 13 additions and 13 deletions
|
@ -17,16 +17,6 @@ pub struct MoveArgs {
|
|||
}
|
||||
|
||||
impl PerItemCommand for Move {
|
||||
fn run(
|
||||
&self,
|
||||
call_info: &CallInfo,
|
||||
_registry: &CommandRegistry,
|
||||
shell_manager: &ShellManager,
|
||||
_input: Tagged<Value>,
|
||||
) -> Result<VecDeque<ReturnValue>, ShellError> {
|
||||
call_info.process(shell_manager, mv)?.run()
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"mv"
|
||||
}
|
||||
|
@ -37,6 +27,16 @@ impl PerItemCommand for Move {
|
|||
.required("destination", SyntaxType::Path)
|
||||
.named("file", SyntaxType::Any)
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
call_info: &CallInfo,
|
||||
_registry: &CommandRegistry,
|
||||
shell_manager: &ShellManager,
|
||||
_input: Tagged<Value>,
|
||||
) -> Result<VecDeque<ReturnValue>, ShellError> {
|
||||
call_info.process(shell_manager, mv)?.run()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn mv(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
mod helpers;
|
||||
|
||||
use h::{in_directory as cwd, Playground, Stub::*};
|
||||
use h::{in_directory as cwd, normalize_string, Playground, Stub::*};
|
||||
use helpers as h;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
|
@ -33,12 +33,12 @@ fn can_understand_known_formats() {
|
|||
r#"
|
||||
enter fortune_tellers.toml
|
||||
cd amigos
|
||||
ls | get unicorns | sum
|
||||
ls | get unicorns | sum
|
||||
exit
|
||||
"#
|
||||
);
|
||||
|
||||
assert!(output.contains("3000"));
|
||||
assert!(normalize_string(&output).contains("3000"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue