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/export.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/poem/anthology/export.rs') diff --git a/src/poem/anthology/export.rs b/src/poem/anthology/export.rs index a61935c..dfbaf81 100644 --- a/src/poem/anthology/export.rs +++ b/src/poem/anthology/export.rs @@ -1,6 +1,19 @@ use crate::poem::Verse; use std::env; +/// export +/// +/// The builtin `export` command. Used to set global environment variables for +/// the current instance of the shell. +/// +/// # Aliases +/// * export +/// * set +/// +/// # Shell Examples +/// ```sh +/// export FOO=BAR +/// ``` pub fn incant(verse: &Verse) -> i32 { match verse.clause() { Some(clause) => { @@ -22,6 +35,16 @@ pub fn incant(verse: &Verse) -> i32 { 0 } +/// unset +/// +/// The builtin `unset` command. Used to remove global environment variables +/// from the current instance of the shell, since `export` may be called with +/// an empty string as the value. +/// +/// # Shell Examples +/// ```sh +/// unset FOO +/// ``` pub fn unincant(verse: &Verse) -> i32 { match verse.clause() { Some(clause) => { -- cgit v1.2.3