refactor: Fix compilation by adding imports and adjusting table methods
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -8,6 +8,7 @@ use log::debug;
|
||||
use regex::Regex;
|
||||
use std::collections::HashMap;
|
||||
use std::env;
|
||||
use std::io::IsTerminal;
|
||||
use std::str::FromStr;
|
||||
use strum::IntoEnumIterator;
|
||||
#[derive(Debug, Clone, strum::EnumString, strum::Display, PartialEq)]
|
||||
@@ -152,7 +153,9 @@ pub fn create_table(use_styling: bool) -> Table {
|
||||
table.load_preset(comfy_table::presets::NOTHING);
|
||||
}
|
||||
|
||||
table.force_no_tty_if(!std::io::stdout().is_terminal());
|
||||
if !std::io::stdout().is_terminal() {
|
||||
table.force_no_tty();
|
||||
}
|
||||
table
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ use std::path::PathBuf;
|
||||
|
||||
use crate::services::item_service::ItemService;
|
||||
use chrono::prelude::*;
|
||||
use is_terminal::IsTerminal;
|
||||
use comfy_table::{Cell, Attribute};
|
||||
|
||||
pub fn mode_info(
|
||||
|
||||
@@ -4,14 +4,14 @@ use crate::services::types::ItemWithMeta;
|
||||
use crate::modes::common::ColumnType;
|
||||
use crate::modes::common::{format_size, OutputFormat};
|
||||
use anyhow::{Result};
|
||||
use log::debug;
|
||||
use comfy_table::{Table, ContentArrangement, Cell, Row, Color, Attribute};
|
||||
use comfy_table::presets::NOTHING;
|
||||
use comfy_table::CellAlignment;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json;
|
||||
use serde_yaml;
|
||||
use std::io::{stdout, IsTerminal};
|
||||
use std::io::{stdout};
|
||||
use std::io::IsTerminal;
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct ListItem {
|
||||
@@ -55,8 +55,11 @@ pub fn mode_list(
|
||||
let mut table = Table::new();
|
||||
table
|
||||
.load_preset(NOTHING)
|
||||
.set_content_arrangement(ContentArrangement::Dynamic)
|
||||
.force_no_tty_if(!stdout().is_terminal());
|
||||
.set_content_arrangement(ContentArrangement::Dynamic);
|
||||
|
||||
if !stdout().is_terminal() {
|
||||
table.force_no_tty();
|
||||
}
|
||||
|
||||
// Create header row
|
||||
let mut header_cells = Vec::new();
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use clap::*;
|
||||
use is_terminal::IsTerminal;
|
||||
use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
use log::debug;
|
||||
@@ -9,7 +8,7 @@ use crate::config;
|
||||
use crate::common::status::StatusInfo;
|
||||
use serde_json;
|
||||
use serde_yaml;
|
||||
use comfy_table::{Cell, Attribute};
|
||||
use comfy_table::{Table, Cell, Attribute};
|
||||
|
||||
use crate::common::status::PathInfo;
|
||||
use crate::meta_plugin::MetaPluginType;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use clap::*;
|
||||
use is_terminal::IsTerminal;
|
||||
use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
use log::debug;
|
||||
@@ -43,7 +42,7 @@ use crate::modes::common::OutputFormat;
|
||||
use crate::config;
|
||||
use serde_json;
|
||||
use serde_yaml;
|
||||
use comfy_table::{Cell, Color, Attribute};
|
||||
use comfy_table::{Table, Cell, Attribute};
|
||||
|
||||
use crate::meta_plugin::{MetaPluginType, get_meta_plugin};
|
||||
use crate::common::status::{MetaPluginInfo, CompressionInfo};
|
||||
|
||||
Reference in New Issue
Block a user