Revert "Heuristic table view"

This commit is contained in:
Jonathan Turner
2019-08-16 04:49:07 +12:00
committed by GitHub
parent 0d09f6ab7f
commit 785536983a
7 changed files with 15 additions and 127 deletions

View File

@@ -54,6 +54,14 @@ pub fn autoview(
let table = context.expect_command("table");
let result = table.run(raw.with_input(input), &context.commands).await.unwrap();
result.collect::<Vec<_>>().await;
//println!("TODO!")
// TODO
// let mut host = context.host.lock().unwrap();
// for i in input.iter() {
// let view = GenericView::new(&i);
// handle_unexpected(&mut *host, |host| crate::format::print_view(&view, host));
// host.stdout("");
// }
}
}
}))

View File

@@ -7,9 +7,7 @@ use futures_async_stream::async_stream_block;
pub struct Table;
#[derive(Deserialize)]
pub struct TableArgs {
full: bool,
}
pub struct TableArgs {}
impl WholeStreamCommand for Table {
fn name(&self) -> &str {
@@ -23,19 +21,16 @@ impl WholeStreamCommand for Table {
args.process(registry, table)?.run()
}
fn signature(&self) -> Signature {
Signature::build("table").switch("full")
Signature::build("table")
}
}
pub fn table(
TableArgs { full }: TableArgs,
context: RunnableContext,
) -> Result<OutputStream, ShellError> {
pub fn table(_args: TableArgs, context: RunnableContext) -> Result<OutputStream, ShellError> {
let stream = async_stream_block! {
let input: Vec<Tagged<Value>> = context.input.into_vec().await;
if input.len() > 0 {
let mut host = context.host.lock().unwrap();
let view = TableView::from_list(&input, full);
let view = TableView::from_list(&input);
if let Some(view) = view {
handle_unexpected(&mut *host, |host| crate::format::print_view(&view, host));
}