diff options
| author | Fuwn <[email protected]> | 2021-05-23 14:16:45 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-23 14:16:45 +0000 |
| commit | 76df7f18237f09c01e5654b6475f4538f9167d79 (patch) | |
| tree | 051de79cf212a82efd9a80732146d0fe65d17bff /crates/whirl_prompt/src/builtins | |
| parent | refactor(config): deprecate refresh method (diff) | |
| download | whirl-76df7f18237f09c01e5654b6475f4538f9167d79.tar.xz whirl-76df7f18237f09c01e5654b6475f4538f9167d79.zip | |
refactor(prompt): move builtins constants to builtins module
Diffstat (limited to 'crates/whirl_prompt/src/builtins')
| -rw-r--r-- | crates/whirl_prompt/src/builtins/constants.rs | 19 | ||||
| -rw-r--r-- | crates/whirl_prompt/src/builtins/mod.rs | 4 |
2 files changed, 21 insertions, 2 deletions
diff --git a/crates/whirl_prompt/src/builtins/constants.rs b/crates/whirl_prompt/src/builtins/constants.rs new file mode 100644 index 0000000..e87cceb --- /dev/null +++ b/crates/whirl_prompt/src/builtins/constants.rs @@ -0,0 +1,19 @@ +// Copyleft (ɔ) 2021-2021 The Whirlsplash Collective +// SPDX-License-Identifier: GPL-3.0-only + +pub const FILES: [&str; 2] = ["README.rst", "Whirl.toml"]; +pub const HELPABLES_BUILTINS: [&str; 8] = [ + "cat - display the contents of a present file", + "config - manipulate the configuration", + "echo - display a line of predefined text", + "exit - end the process", + "fetch - a neofetch like utility loosely based on rfetch", + "help - you are here", + "history - display the command history", + "ls - display the present files", +]; +pub const HELPABLES_BUILTIN_CONFIG: [&str; 2] = [ + "help - you are here", + // "refresh - reload the configuration file", + "show - display the current configuration", +]; diff --git a/crates/whirl_prompt/src/builtins/mod.rs b/crates/whirl_prompt/src/builtins/mod.rs index 556408b..62031de 100644 --- a/crates/whirl_prompt/src/builtins/mod.rs +++ b/crates/whirl_prompt/src/builtins/mod.rs @@ -1,15 +1,15 @@ // Copyleft (ɔ) 2021-2021 The Whirlsplash Collective // SPDX-License-Identifier: GPL-3.0-only +pub mod constants; pub mod structures; use std::io::Write; +use constants::{FILES, HELPABLES_BUILTINS, HELPABLES_BUILTIN_CONFIG}; use sysinfo::SystemExt; use whirl_config::Config; -use crate::constants::{FILES, HELPABLES_BUILTINS, HELPABLES_BUILTIN_CONFIG}; - pub fn builtin_echo(args: &[String]) -> i32 { println!("{}", args.join(" ")); 0 |