2022-03-26 09:42:19 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
2020-09-25 22:04:51 +00:00
|
|
|
|
2022-03-26 09:42:19 +00:00
|
|
|
#[derive(Clone, Deserialize, Serialize)]
|
2022-04-01 15:14:05 +00:00
|
|
|
#[cfg_attr(feature = "config-schema", derive(schemars::JsonSchema))]
|
2022-03-26 09:42:19 +00:00
|
|
|
#[serde(default)]
|
2020-09-25 22:04:51 +00:00
|
|
|
pub struct StatusConfig<'a> {
|
|
|
|
pub format: &'a str,
|
|
|
|
pub symbol: &'a str,
|
2021-07-28 16:26:00 +00:00
|
|
|
pub success_symbol: &'a str,
|
2021-01-03 03:09:13 +00:00
|
|
|
pub not_executable_symbol: &'a str,
|
|
|
|
pub not_found_symbol: &'a str,
|
|
|
|
pub sigint_symbol: &'a str,
|
|
|
|
pub signal_symbol: &'a str,
|
2020-09-25 22:04:51 +00:00
|
|
|
pub style: &'a str,
|
2021-01-03 03:09:13 +00:00
|
|
|
pub map_symbol: bool,
|
|
|
|
pub recognize_signal_code: bool,
|
2021-07-28 16:26:00 +00:00
|
|
|
pub pipestatus: bool,
|
|
|
|
pub pipestatus_separator: &'a str,
|
|
|
|
pub pipestatus_format: &'a str,
|
2022-07-19 13:07:50 +00:00
|
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
|
|
pub pipestatus_segment_format: Option<&'a str>,
|
2020-09-25 22:04:51 +00:00
|
|
|
pub disabled: bool,
|
|
|
|
}
|
|
|
|
|
2021-03-15 10:40:52 +00:00
|
|
|
impl<'a> Default for StatusConfig<'a> {
|
|
|
|
fn default() -> Self {
|
2020-09-25 22:04:51 +00:00
|
|
|
StatusConfig {
|
|
|
|
format: "[$symbol$status]($style) ",
|
|
|
|
symbol: "✖",
|
2022-03-16 20:05:13 +00:00
|
|
|
success_symbol: "",
|
2021-01-03 03:09:13 +00:00
|
|
|
not_executable_symbol: "🚫",
|
|
|
|
not_found_symbol: "🔍",
|
|
|
|
sigint_symbol: "🧱",
|
|
|
|
signal_symbol: "⚡",
|
2020-09-25 22:04:51 +00:00
|
|
|
style: "bold red",
|
2021-01-03 03:09:13 +00:00
|
|
|
map_symbol: false,
|
|
|
|
recognize_signal_code: true,
|
2021-07-28 16:26:00 +00:00
|
|
|
pipestatus: false,
|
|
|
|
pipestatus_separator: "|",
|
|
|
|
pipestatus_format:
|
|
|
|
"\\[$pipestatus\\] => [$symbol$common_meaning$signal_name$maybe_int]($style)",
|
2022-07-19 13:07:50 +00:00
|
|
|
pipestatus_segment_format: None,
|
2020-09-25 22:04:51 +00:00
|
|
|
disabled: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|