diff options
author | Rory Dudley | 2024-03-30 23:06:41 -0600 |
---|---|---|
committer | Rory Dudley | 2024-03-30 23:06:41 -0600 |
commit | 90b4e0226d49f4f61300f91b6a9b1e7978bd2f9b (patch) | |
tree | 120c688689ec9104abdfba5c3989ae0e544fc80e /src/poem/recite.rs | |
parent | 75872c78614abbdfec6b5fdd5ada1292d76fd5d8 (diff) | |
download | dwarvish-90b4e0226d49f4f61300f91b6a9b1e7978bd2f9b.tar.gz |
Better comments in recite()
Add some better comments/move around existing comments to make some of
the actions in recite() more clear.
Diffstat (limited to 'src/poem/recite.rs')
-rw-r--r-- | src/poem/recite.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/poem/recite.rs b/src/poem/recite.rs index a067f3d..d95af92 100644 --- a/src/poem/recite.rs +++ b/src/poem/recite.rs @@ -139,12 +139,15 @@ impl Reciteable for Poem { let status = if index.is_some() { anthology::incant(&verse, index.unwrap(), env) } else { - // Incant the verse, based on its meter - // Check if the verb exists - // If it doesn't exist, try refreshing the binary cache, and check - // again - // If it still doesn't exist, print an error + // Checking for environment variables and running internal + // poems may mean that the verb is empty now, so check it once + // more + // If it is empty, just continue to the next verse if !verse.verb().is_empty() { + // Check if the verb exists on the PATH + // If it doesn't exist, try refreshing the binary cache, and check + // again + // If it still doesn't exist, print an error if !verse.spellcheck(&env.bins) { env.bins = path::refresh(); if !verse.spellcheck(&env.bins) { @@ -159,6 +162,7 @@ impl Reciteable for Poem { continue; } + // Incant the verse, based on its meter if stdout { match verse.io { Rune::Read => Rune::incant_read(&mut verse, &mut out, &mut pids)?, |