2019-08-19 05:16:39 +00:00
|
|
|
use crate::commands::WholeStreamCommand;
|
2019-05-10 16:59:12 +00:00
|
|
|
use crate::errors::ShellError;
|
2019-05-13 17:30:51 +00:00
|
|
|
use crate::prelude::*;
|
2019-05-10 16:59:12 +00:00
|
|
|
|
2019-08-19 05:16:39 +00:00
|
|
|
pub struct LS;
|
|
|
|
|
|
|
|
impl WholeStreamCommand for LS {
|
|
|
|
fn run(
|
|
|
|
&self,
|
|
|
|
args: CommandArgs,
|
|
|
|
registry: &CommandRegistry,
|
|
|
|
) -> Result<OutputStream, ShellError> {
|
|
|
|
ls(args, registry)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn name(&self) -> &str {
|
|
|
|
"ls"
|
|
|
|
}
|
|
|
|
|
|
|
|
fn signature(&self) -> Signature {
|
|
|
|
Signature::build("ls").optional("path", SyntaxType::Path)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn ls(args: CommandArgs, registry: &CommandRegistry) -> Result<OutputStream, ShellError> {
|
2019-08-09 05:36:43 +00:00
|
|
|
let shell_manager = args.shell_manager.clone();
|
|
|
|
let args = args.evaluate_once(registry)?;
|
|
|
|
shell_manager.ls(args)
|
2019-05-10 16:59:12 +00:00
|
|
|
}
|