From 791b61f97e3ee12dfd765f5e23edd5df527eb803 Mon Sep 17 00:00:00 2001 From: Rory Dudley Date: Sun, 31 Mar 2024 00:50:03 -0600 Subject: Add docstring comments to all the anthology functions Add docstring comments for all the incant function throughout the anthology, documenting what each function does, and an example of it's shell command. --- src/poem/anthology/cd.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/poem/anthology/cd.rs') diff --git a/src/poem/anthology/cd.rs b/src/poem/anthology/cd.rs index d3a1998..5b39359 100644 --- a/src/poem/anthology/cd.rs +++ b/src/poem/anthology/cd.rs @@ -1,6 +1,17 @@ use crate::poem::Verse; use std::env; +/// cd +/// +/// The builtin `cd` command. Used to change directories. This must be +/// implemented by the shell, since the `pwd` is context sensitive within a +/// process. If no arguments are given, `cd` will take the user back to their +/// home directory (i.e. `~`). +/// +/// # Shell Example +/// ```sh +/// cd ~/.config # Change into /home//.config +/// ``` pub fn incant(verse: &Verse) -> i32 { let path = match verse.clause() { Some(path) => path[0].to_string(), -- cgit v1.2.3