From 90b4e0226d49f4f61300f91b6a9b1e7978bd2f9b Mon Sep 17 00:00:00 2001 From: Rory Dudley Date: Sat, 30 Mar 2024 23:06:41 -0600 Subject: Better comments in recite() Add some better comments/move around existing comments to make some of the actions in recite() more clear. --- src/poem/recite.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/poem') 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)?, -- cgit v1.2.3