diff options
author | Rory Dudley | 2024-06-30 20:09:26 -0600 |
---|---|---|
committer | Rory Dudley | 2024-06-30 20:09:26 -0600 |
commit | b8338719e2cc2138bc67c10ad56fb707f5e3b546 (patch) | |
tree | c27c2dc3a6dc7491da94e47eaad4530e855d17f1 /src/compose.rs | |
parent | e23e4a036008a6f3a3356d48434615a05dcc17e0 (diff) | |
download | dwarvish-b8338719e2cc2138bc67c10ad56fb707f5e3b546.tar.gz |
Add/update doc comments
This patch update a ton of the documentation comments throughout the
codebase, refactoring some areas, and adding new comments to others.
Diffstat (limited to 'src/compose.rs')
-rw-r--r-- | src/compose.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/compose.rs b/src/compose.rs index dfbbaef..b12d1a4 100644 --- a/src/compose.rs +++ b/src/compose.rs @@ -5,6 +5,14 @@ use std::env; use std::fs; use std::path::PathBuf; +/// Setup the global shell environment +/// +/// Sets up the shell's environment via configuration files. In order: +/// * `/etc/dwvshrc` +/// * `~/.dwvshrc` +/// +/// For debug builds, all files will instead be sourced from +/// `./dist/...` with the exception of `~/.dwvshrc`. pub fn env() -> Environment { // Create a new Environment object, to store some extra shell info let mut env = Environment::new(); @@ -39,6 +47,13 @@ pub fn env() -> Environment { env } +/// Read, read, and recite +/// +/// Small, reusable function used to do the heavy lifting in regards to +/// sourcing configuration files. [Read][fs::read_to_string]s a file +/// from disk, then [read][crate::poem::read]s (parses) a [Poem], +/// then [recite][crate::poem::recite]s that [Poem]. +/// Configuration files are just shell scripts. fn rrr(path: PathBuf, env: &mut Environment) { let poetry = match fs::read_to_string(&path) { Ok(poetry) => poetry, |