From b38189355bab7921b9e9c17c4e6f1b936cc4dffc Mon Sep 17 00:00:00 2001 From: Nathan Helmig Date: Sat, 20 Jul 2024 18:33:33 -0500 Subject: [PATCH 1/4] feat: adds some friendly tips describing things about hilbish like features, documentation, etc. --- CHANGELOG.md | 3 +++ nature/opts/init.lua | 3 ++- nature/opts/tips.lua | 26 ++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 nature/opts/tips.lua diff --git a/CHANGELOG.md b/CHANGELOG.md index f0f00a0..7973455 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## [2.3.0] - 2024-07-20 ### Added +- `nature.opts.tips` was added to randomly generate tips on start up. +Follows the pattern of motd and greeting. Displays after greeting on start up. +### Added - `commander.registry` function to get all registered commanders. - `fs.pipe` function to get a pair of connected files (a pipe). - Added an alternative 2nd parameter to `hilbish.run`, which is `streams`. diff --git a/nature/opts/init.lua b/nature/opts/init.lua index 474ea3b..d55864f 100644 --- a/nature/opts/init.lua +++ b/nature/opts/init.lua @@ -14,7 +14,8 @@ The nice lil shell for {blue}Lua{reset} fanatics! motd = true, fuzzy = false, notifyJobFinish = true, - crimmas = true + crimmas = true, + tips = true } for optsName, default in pairs(defaultOpts) do diff --git a/nature/opts/tips.lua b/nature/opts/tips.lua new file mode 100644 index 0000000..e835fc8 --- /dev/null +++ b/nature/opts/tips.lua @@ -0,0 +1,26 @@ +local bait = require 'bait' +local lunacolors = require 'lunacolors' + +PREAMBLE = [[ +Getting Started: https://rosettea.github.io/Hilbish/docs/getting-started/ +Documentation: https://rosettea.github.io/Hilbish/ +Github: https://github.com/Rosettea/Hilbish +]] + +hilbish.tips = { + "Join the discord and say hi! -> https://discord.gg/3PDdcQz", + "{green}hilbish.alias{reset} -> Sets an alias to another cmd", + "{green}hilbish.appendPath{reset} -> Appends the provided dir to the command path ($PATH)", + "{green}hilbish.appendPath{reset} -> Appends the provided dir to the command path ($PATH)", + [[ + Add Lua-written commands with the commander module! + Checkout the docs here -> https://rosettea.github.io/Hilbish/docs/api/commander/ + ]] +} + +bait.catch('hilbish.init', function() + if hilbish.interactive and hilbish.opts.tip then + local idx = math.random(1, #hilbish.tips) + print(lunacolors.format(PREAMBLE .. "\nTip: " .. hilbish.tips[idx])) + end +end) From 2bf037e51b6a951d74d7304374d8dd529ce15261 Mon Sep 17 00:00:00 2001 From: Nathan Helmig Date: Sat, 20 Jul 2024 19:21:04 -0500 Subject: [PATCH 2/4] fix: added a few more tips related to hilbish features --- CHANGELOG.md | 4 +++- nature/opts/tips.lua | 13 +++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7973455..f130876 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,11 @@ # 🎀 Changelog -## [2.3.0] - 2024-07-20 +## Unreleased ### Added - `nature.opts.tips` was added to randomly generate tips on start up. Follows the pattern of motd and greeting. Displays after greeting on start up. + +## [2.3.0] - 2024-07-20 ### Added - `commander.registry` function to get all registered commanders. - `fs.pipe` function to get a pair of connected files (a pipe). diff --git a/nature/opts/tips.lua b/nature/opts/tips.lua index e835fc8..f0b173d 100644 --- a/nature/opts/tips.lua +++ b/nature/opts/tips.lua @@ -11,9 +11,18 @@ hilbish.tips = { "Join the discord and say hi! -> https://discord.gg/3PDdcQz", "{green}hilbish.alias{reset} -> Sets an alias to another cmd", "{green}hilbish.appendPath{reset} -> Appends the provided dir to the command path ($PATH)", - "{green}hilbish.appendPath{reset} -> Appends the provided dir to the command path ($PATH)", + "{green}hilbish.completions{reset} -> Are use to control suggestions when tab completing.", + "{green}hilbish.message{reset} -> Simple notification system which can be used by other plugins and parts of the shell to notify the user of various actions.", [[ - Add Lua-written commands with the commander module! + {green}hilbish.opts{reset} -> Simple toggle or value options a user can set. + - EX: hilbish.opts.greeting = false, will cause the greeting message on start-up to not display. + ]], + [[ + {green}hilbish.runner{reset} -> The runner interface contains functions that allow the user to change how Hilbish interprets interactive input. + - The default runners can run shell script and Lua code. + ]], + [[ + Add Lua-written commands with the commander module! Checkout the docs here -> https://rosettea.github.io/Hilbish/docs/api/commander/ ]] } From 303c9d0b78e13f6c9249659fd63f76b6209f5314 Mon Sep 17 00:00:00 2001 From: Nathan Helmig Date: Sat, 20 Jul 2024 19:22:24 -0500 Subject: [PATCH 3/4] fix: shortend the preamble to just the getting started link --- nature/opts/tips.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/nature/opts/tips.lua b/nature/opts/tips.lua index f0b173d..d3eb45f 100644 --- a/nature/opts/tips.lua +++ b/nature/opts/tips.lua @@ -1,11 +1,7 @@ local bait = require 'bait' local lunacolors = require 'lunacolors' -PREAMBLE = [[ -Getting Started: https://rosettea.github.io/Hilbish/docs/getting-started/ -Documentation: https://rosettea.github.io/Hilbish/ -Github: https://github.com/Rosettea/Hilbish -]] +PREAMBLE = "Getting Started: https://rosettea.github.io/Hilbish/docs/getting-started/\n" hilbish.tips = { "Join the discord and say hi! -> https://discord.gg/3PDdcQz", From e2c9aca19dc266734244059f48bf93c4a4ba04d3 Mon Sep 17 00:00:00 2001 From: Nathan Helmig Date: Sun, 21 Jul 2024 16:17:23 -0500 Subject: [PATCH 4/4] fix: added to the preamble instructions on how to turn of the tips --- nature/opts/tips.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nature/opts/tips.lua b/nature/opts/tips.lua index d3eb45f..baaf35a 100644 --- a/nature/opts/tips.lua +++ b/nature/opts/tips.lua @@ -1,7 +1,10 @@ local bait = require 'bait' local lunacolors = require 'lunacolors' -PREAMBLE = "Getting Started: https://rosettea.github.io/Hilbish/docs/getting-started/\n" +PREAMBLE = [[ +Getting Started: https://rosettea.github.io/Hilbish/docs/getting-started/ +🛈 These tips can be disabled with hilbish.opts.tips = false +]] hilbish.tips = { "Join the discord and say hi! -> https://discord.gg/3PDdcQz",