summaryrefslogtreecommitdiffstats
path: root/src/poem/anthology/which.rs
diff options
context:
space:
mode:
authorRory Dudley2024-06-30 20:09:26 -0600
committerRory Dudley2024-06-30 20:09:26 -0600
commitb8338719e2cc2138bc67c10ad56fb707f5e3b546 (patch)
treec27c2dc3a6dc7491da94e47eaad4530e855d17f1 /src/poem/anthology/which.rs
parente23e4a036008a6f3a3356d48434615a05dcc17e0 (diff)
downloaddwarvish-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/poem/anthology/which.rs')
-rw-r--r--src/poem/anthology/which.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/poem/anthology/which.rs b/src/poem/anthology/which.rs
index 0872dda..9a1708a 100644
--- a/src/poem/anthology/which.rs
+++ b/src/poem/anthology/which.rs
@@ -4,6 +4,18 @@ use crate::poem::Verse;
use std::os::unix::process::ExitStatusExt;
use std::process::{ExitStatus, Output};
+/// which
+///
+/// The built-in `which` command. Used to check what program would be
+/// called when not providing a full path. On Linux, it seems most
+/// distros ship with a standalone `which` program. BSD systems, on the
+/// other hand, tend to just use the shell built-in.
+///
+/// # Shell Examples
+/// ```sh
+/// which ls # -> /bin/ls
+/// which exit # -> shell built-in command
+/// ```
pub fn incant(clause: &Option<Vec<String>>, uout: bool, uerr: bool, env: &Environment) -> Output {
let mut status = 0;
let mut out: Vec<u8> = Vec::new();