Skip to content

Commit 81f3693

Browse files
committed
Move banner to help section to reduce the amount of tokens LLM models will have to spend to run taskfile commands
1 parent ceba6ff commit 81f3693

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Taskfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ function title {
125125
}
126126

127127
function task:help { ## Show all available tasks
128+
banner
128129
title "Available tasks"
129130
awk 'BEGIN {FS = " { [#][#][ ]?"} /^([a-zA-Z_-]*:?.*)(\{ )?[#][#][ ]?/ \
130131
{printf "\033[33m%-34s\033[0m %s\n", $1, $2}' $0 |\
@@ -141,7 +142,6 @@ function task:shorthand { ## Create CLI shorthand task instead of ./Taskfile
141142
echo -e "${BLUE}You can now use:${RESET} task ${YELLOW}<task>${RESET} <arguments>"
142143
}
143144

144-
banner
145145
if [[ ! "$(declare -F task:${@-help})" ]]; then
146146
title "Task not found"
147147
echo -e "Task ${YELLOW}$1${RESET} doesn't exist."

src/components/Generator/GeneredTaskfile/taskfile-base.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ function title {
5353
}
5454

5555
function task:help { ## Show all available tasks
56+
banner
5657
title "Available tasks"
5758
awk 'BEGIN {FS = " { [#][#][ ]?"} /^([a-zA-Z_-]*:?.*)(\{ )?[#][#][ ]?/ \
5859
{printf "\033[33m%-34s\033[0m %s\n", $1, $2}' $0 |\
@@ -69,7 +70,6 @@ function task:shorthand { ## Create CLI shorthand task instead of ./Taskfile
6970
echo -e "${BLUE}You can now use:${RESET} task ${YELLOW}<task>${RESET} <args>"
7071
}
7172

72-
banner
7373
if [[ ! "$(declare -F task:${@-help})" ]]; then
7474
title "Task not found"
7575
echo -e "Task ${RED}$1${RESET} doesn't exist."

0 commit comments

Comments
 (0)