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/alias.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/poem/anthology/alias.rs') diff --git a/src/poem/anthology/alias.rs b/src/poem/anthology/alias.rs index 6a8e739..96682db 100644 --- a/src/poem/anthology/alias.rs +++ b/src/poem/anthology/alias.rs @@ -1,6 +1,15 @@ use crate::poem::Verse; use std::collections::HashMap; +/// alias +/// +/// The builtin `alias` command. Used to monikers for other verbs, or entire +/// verses. +/// +/// # Shell Example +/// ```sh +/// alias vim=nvim +/// ``` pub fn incant(verse: &Verse, aliases: &mut HashMap) -> i32 { match verse.clause() { Some(clause) => { @@ -31,6 +40,15 @@ pub fn incant(verse: &Verse, aliases: &mut HashMap) -> i32 { 0 } +/// unalias +/// +/// The builtin `unalias` command. Used to remove shell monikers, since `alias` +/// may be called with an empty string as the value. +/// +/// # Shell Example +/// ```sh +/// unalias vim +/// ``` pub fn unincant(verse: &Verse, aliases: &mut HashMap) -> i32 { match verse.clause() { Some(clause) => { -- cgit v1.2.3