forked from extern/nushell
mv -> More organized method definitions.
This commit is contained in:
parent
11095860c8
commit
0f28719564
@ -17,16 +17,6 @@ pub struct MoveArgs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl PerItemCommand for Move {
|
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 {
|
fn name(&self) -> &str {
|
||||||
"mv"
|
"mv"
|
||||||
}
|
}
|
||||||
@ -37,6 +27,16 @@ impl PerItemCommand for Move {
|
|||||||
.required("destination", SyntaxType::Path)
|
.required("destination", SyntaxType::Path)
|
||||||
.named("file", SyntaxType::Any)
|
.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(
|
pub fn mv(
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
mod helpers;
|
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 helpers as h;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
@ -33,12 +33,12 @@ fn can_understand_known_formats() {
|
|||||||
r#"
|
r#"
|
||||||
enter fortune_tellers.toml
|
enter fortune_tellers.toml
|
||||||
cd amigos
|
cd amigos
|
||||||
ls | get unicorns | sum
|
ls | get unicorns | sum
|
||||||
exit
|
exit
|
||||||
"#
|
"#
|
||||||
);
|
);
|
||||||
|
|
||||||
assert!(output.contains("3000"));
|
assert!(normalize_string(&output).contains("3000"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
Reference in New Issue
Block a user