feat: More presentation slides.
This commit is contained in:
16
bin/run
16
bin/run
@@ -10,7 +10,10 @@ zparseopts -D -E -- \
|
||||
-show-history=showhistory \
|
||||
-show-me-the-chillers=showchillers \
|
||||
-ask-chat-gpt:=askgpt \
|
||||
-output:=outputFile
|
||||
-output:=outputFile \
|
||||
-show-hvac-characteristics=showhvac \
|
||||
-copy-gpt-output:=copygpt \
|
||||
-show-the-diff-yo=showdiff
|
||||
|
||||
######################### Helpers #########################
|
||||
|
||||
@@ -24,6 +27,11 @@ function spinner {
|
||||
gum spin --title "$1" -- sleep "${2:-5}"
|
||||
}
|
||||
|
||||
function getGptOutput {
|
||||
local json=$1
|
||||
echo "$(cat "files/$json" | jq '.["choices"][0]["message"]["content"]')"
|
||||
}
|
||||
|
||||
function parseGpt {
|
||||
local json=$1
|
||||
local header=$2
|
||||
@@ -69,4 +77,10 @@ elif [ ! -z "$askgpt" ]; then
|
||||
local file="${outputFile[-1]}"
|
||||
spinner "Asking ChatGPT..."
|
||||
askChatGpt $question $file
|
||||
elif [ ! -z "$showhvac" ]; then
|
||||
echo "$(parseGpt 'hvac.json' '# HVAC Components')" | gum format | gum pager
|
||||
elif [ ! -z "$copygpt" ]; then
|
||||
echo "$(getGptOutput ${copygpt[-1]})" | pbcopy
|
||||
elif [ ! -z "$showdiff" ]; then
|
||||
echo "$(parseGpt 'diff.json' '# Key Differences')" | gum format | gum pager
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user