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