diff options
author | Rory Dudley | 2024-03-31 00:50:03 -0600 |
---|---|---|
committer | Rory Dudley | 2024-03-31 00:50:03 -0600 |
commit | 791b61f97e3ee12dfd765f5e23edd5df527eb803 (patch) | |
tree | beec5cfab87229b84897aa038b514e08d4532665 /src/poem/anthology/export.rs | |
parent | f03f4e0fcf62c9b3267bc5d8b62068d89ec593cd (diff) | |
download | dwarvish-791b61f97e3ee12dfd765f5e23edd5df527eb803.tar.gz |
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.
Diffstat (limited to 'src/poem/anthology/export.rs')
-rw-r--r-- | src/poem/anthology/export.rs | 23 |
1 files changed, 23 insertions, 0 deletions
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) => { |