mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 22:57:58 +02:00
add ability to specify an ansi style (#595)
* add ability to specify an ansi style * remove comments * remove more debug code * some cleanup and refactoring
This commit is contained in:
@ -2,13 +2,13 @@ use nu_ansi_term::{Color, Style};
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Deserialize, PartialEq, Debug)]
|
||||
struct NuStyle {
|
||||
fg: Option<String>,
|
||||
bg: Option<String>,
|
||||
attr: Option<String>,
|
||||
pub struct NuStyle {
|
||||
pub fg: Option<String>,
|
||||
pub bg: Option<String>,
|
||||
pub attr: Option<String>,
|
||||
}
|
||||
|
||||
fn parse_nustyle(nu_style: NuStyle) -> Style {
|
||||
pub fn parse_nustyle(nu_style: NuStyle) -> Style {
|
||||
// get the nu_ansi_term::Color foreground color
|
||||
let fg_color = match nu_style.fg {
|
||||
Some(fg) => color_from_hex(&fg).expect("error with foreground color"),
|
||||
|
Reference in New Issue
Block a user