diff options
author | pommicket <pommicket@gmail.com> | 2025-09-07 23:08:56 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-09-07 23:08:56 -0400 |
commit | 858ee035533a5bcbe6e68ea7054b36083752b563 (patch) | |
tree | bdd03fe17efd3f9b635374b5ec13f1bfd5bf2f27 /examples | |
parent | 39b31c18e9ff16c12cbb723a9d897ca34d9aef6d (diff) |
Fix various bugs
Diffstat (limited to 'examples')
-rw-r--r-- | examples/conf.pom | 22 | ||||
-rw-r--r-- | examples/simple.rs | 14 |
2 files changed, 34 insertions, 2 deletions
diff --git a/examples/conf.pom b/examples/conf.pom index 90483f6..fde2274 100644 --- a/examples/conf.pom +++ b/examples/conf.pom @@ -1 +1,21 @@ -fav-colour = `green` + +indent-using-spaces = yes +show-line-numbers = yes +tab-size = 4 +font-size = 18 + +[file-extensions] +C = .c +Cpp = .cpp, .h, .hpp + +[plug-in.edit-over-ssh] +path = ~/misc/edit-over-ssh.so +enabled = yes + +[plug-in.edit-over-ssh.settings] +favourite-host = my-web-server + +[plug-in.edit-over-ssh.settings.hosts.my-web-server] +address = example.org +port = 22 +ssh-key = ~/.ssh/id_ed25519 diff --git a/examples/simple.rs b/examples/simple.rs index 161baac..a536f44 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -3,7 +3,19 @@ use std::process::ExitCode; fn try_main() -> Result<(), Box<dyn std::error::Error>> { let conf = Configuration::load_path("examples/conf.pom")?; - println!("{conf}"); + println!("tab width is {}", conf.get_int_or_default("tab-size", 8)?); + println!( + "indenting with {}", + if conf.get_bool_or_default("indent-using-spaces", false)? { + "spaces" + } else { + "tabs" + } + ); + println!( + "edit-over-ssh plug-in path: {:?}", + conf.get("plug-in.edit-over-ssh.path") + ); Ok(()) } |