mirror of
https://github.com/nushell/nushell
synced 2024-12-28 14:03:09 +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 {
|
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};
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ fn can_understand_known_formats() {
|
||||||
"#
|
"#
|
||||||
);
|
);
|
||||||
|
|
||||||
assert!(output.contains("3000"));
|
assert!(normalize_string(&output).contains("3000"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Reference in a new issue