Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 1.29 KB

README.md

File metadata and controls

30 lines (22 loc) · 1.29 KB

sysctl-conf

example workflow

Program to parse sysctl.conf(5) formatted documents as an assignment for Miletos employment.

To test the program please run it with example file provided like this:

$ cargo run sysctl.conf
Sysctl { variable: "endpoint", value: Str("localhost:3000"), ignore_failure: false }
Sysctl { variable: "debug", value: Bool(true), ignore_failure: false }
Sysctl { variable: "log.file", value: Str("/var/log/console.log"), ignore_failure: false }

Each line represents the variable to set, the value to set it to, and whether failing to set it should be ignored.

You can also provide a schema to validate the type of the values.

$ cargo run sysctl.conf sysctl.schema
Sysctl { variable: "endpoint", value: Str("localhost:3000"), ignore_failure: false }
Sysctl { variable: "debug", value: Bool(true), ignore_failure: false }
Sysctl { variable: "log.file", value: Str("/var/log/console.log"), ignore_failure: false }