fix: move format constant to common and update stdout check
This commit is contained in:
@@ -4,7 +4,7 @@ use clap::Command;
|
||||
use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
|
||||
use crate::modes::common::{format_size, string_column};
|
||||
use crate::modes::common::{format_size, string_column, FORMAT_BOX_CHARS_NO_BORDER_LINE_SEPARATOR};
|
||||
use crate::compression::get_engine;
|
||||
use crate::compression::CompressionType;
|
||||
use crate::db::{get_item, get_item_last, get_item_matching};
|
||||
@@ -49,8 +49,8 @@ pub fn mode_info(
|
||||
.collect();
|
||||
|
||||
let mut table = Table::new();
|
||||
if is_terminal::stdout().is_terminal() {
|
||||
table.set_format(*format::consts::FORMAT_BOX_CHARS_NO_BORDER_LINE_SEPARATOR);
|
||||
if std::io::stdout().is_terminal() {
|
||||
table.set_format(*FORMAT_BOX_CHARS_NO_BORDER_LINE_SEPARATOR);
|
||||
} else {
|
||||
table.set_format(*format::consts::FORMAT_NO_BORDER_LINE_SEPARATOR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user