Implement WholeStreamCommand for all remaining commands

This commit is contained in:
Odin Dutton
2019-08-19 15:16:39 +10:00
parent 095f4645c0
commit d71206ed9e
33 changed files with 732 additions and 169 deletions

View File

@ -1,8 +1,30 @@
use crate::commands::WholeStreamCommand;
use crate::errors::ShellError;
use crate::object::TaggedDictBuilder;
use crate::prelude::*;
pub fn shells(args: CommandArgs, _registry: &CommandRegistry) -> Result<OutputStream, ShellError> {
pub struct Shells;
impl WholeStreamCommand for Shells {
fn run(
&self,
args: CommandArgs,
registry: &CommandRegistry,
) -> Result<OutputStream, ShellError> {
shells(args, registry)
}
fn name(&self) -> &str {
"shells"
}
fn signature(&self) -> Signature {
// TODO: Signature?
Signature::build("shells")
}
}
fn shells(args: CommandArgs, _registry: &CommandRegistry) -> Result<OutputStream, ShellError> {
let mut shells_out = VecDeque::new();
let span = args.call_info.name_span;