updated man, version, and allow more data types in config variables

This commit is contained in:
Valerie Wolfe 2024-07-05 14:36:31 -04:00
parent 4f66db254c
commit f873367a51
3 changed files with 43 additions and 2 deletions

View file

@ -1,6 +1,6 @@
[package] [package]
name = "oink" name = "oink"
version = "0.2.0" version = "0.2.1"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

34
man/oink.1 Normal file
View file

@ -0,0 +1,34 @@
.Dd $Mdocdate$
.Dt OINK 1
.Os
.Sh NAME
.Nm oink
.Nd a configuration file preprocessor
.Sh SYNOPSIS
.Nm
.Ar command
.Sh DESCRIPTION
.Nm
is a configuration file preprocessor focused on centralizing configuration changes.
.Ss COMMANDS
.Bl -tag -width Ds
.It apply
Copies the last generated files to their target paths.
.It build
Generates files from their templates.
.It full
Runs 'build', then 'apply'.
.El
.Sh EXIT STATUS
.Bl -tag -width Ds
.It 1
No command was given.
.It 2
The configuration file has no items in the target array.
.It 3
Failed to create the configuration directories.
.El
.Sh AUTHORS
.An -nosplit
.An Valerie Wolfe Aq Mt sleeplessval@gmail.com

View file

@ -63,7 +63,14 @@ impl Config {
// pull global vars // pull global vars
if let Some(Value::Table(vars)) = self.inner.get("vars") { if let Some(Value::Table(vars)) = self.inner.get("vars") {
for (key, value) in vars.iter() { for (key, value) in vars.iter() {
output.insert(key.to_owned(), value.as_str().into()); let key = key.to_owned();
match value.clone() {
Value::Boolean(bool) => output.insert(key, bool.into()),
Value::Float(float) => output.insert(key, float.into()),
Value::Integer(int) => output.insert(key, int.into()),
Value::String(string) => output.insert(key, string.into()),
_ => None
};
} }
} }