summaryrefslogtreecommitdiffstats
path: root/src/configs/odin.rs
diff options
context:
space:
mode:
author[Error_27] <error27dev@gmail.com>2024-04-05 17:56:49 -0400
committerGitHub <noreply@github.com>2024-04-05 23:56:49 +0200
commit335c514e9ee5fa5bc8a8294b4804ddf198504b97 (patch)
tree0b1cbf1398416142864a110f92a30483aeaf0338 /src/configs/odin.rs
parent34a8f7e62845fd66df3f6f9003cb850f2b0d9bc5 (diff)
feat(odin): Add Odin Lang module (#5873)
* Add Odin lang module * add utils string and remove commit number from output * switch to new symbol because ZWJ support is rare * add config docs * add option to show the commit number * fix lack of trimming * fix formatting to comply with checks * Add trailing newline to comply with cargo fmt * Add new Odin test and add newline in cmd output
Diffstat (limited to 'src/configs/odin.rs')
-rw-r--r--src/configs/odin.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/configs/odin.rs b/src/configs/odin.rs
new file mode 100644
index 000000000..4fb1d5817
--- /dev/null
+++ b/src/configs/odin.rs
@@ -0,0 +1,34 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Clone, Deserialize, Serialize)]
+#[cfg_attr(
+ feature = "config-schema",
+ derive(schemars::JsonSchema),
+ schemars(deny_unknown_fields)
+)]
+#[serde(default)]
+pub struct OdinConfig<'a> {
+ pub format: &'a str,
+ pub show_commit: bool,
+ pub symbol: &'a str,
+ pub style: &'a str,
+ pub disabled: bool,
+ pub detect_extensions: Vec<&'a str>,
+ pub detect_files: Vec<&'a str>,
+ pub detect_folders: Vec<&'a str>,
+}
+
+impl<'a> Default for OdinConfig<'a> {
+ fn default() -> Self {
+ OdinConfig {
+ format: "via [$symbol($version )]($style)",
+ show_commit: false,
+ symbol: "Ø ",
+ style: "bold bright-blue",
+ disabled: false,
+ detect_extensions: vec!["odin"],
+ detect_files: vec![],
+ detect_folders: vec![],
+ }
+ }
+}