FZF_(HEAD|TAIL) refactor to FZF_USER_INPUT

This commit is contained in:
Wryn (yage) Wagner 2024-02-12 23:44:43 -07:00
parent 432593a0f3
commit b6b4f2e5b8
5 changed files with 8 additions and 8 deletions

View File

@ -12,7 +12,7 @@ SCWRYPTS__SELECT_ENV() {
}
SCWRYPTS__SELECT_OR_CREATE_ENV() {
SCWRYPTS__GET_ENV_NAMES | FZF_TAIL 'select / create an environment'
SCWRYPTS__GET_ENV_NAMES | FZF_USER_INPUT 'select / create an environment'
}
SCWRYPTS__GET_ENV_FILES() {

View File

@ -5,7 +5,7 @@ use media/youtube
MAIN() {
local URLS=($@)
[[ ${#URLS[@]} -eq 0 ]] && URLS=($(echo '' | FZF_HEAD 'enter URL'))
[[ ${#URLS[@]} -eq 0 ]] && URLS=($(echo '' | FZF_USER_INPUT 'enter URL'))
[[ ${#URLS[@]} -eq 0 ]] && ABORT
local FILENAME=$(YT__GET_FILENAME $URLS)

View File

@ -5,7 +5,7 @@ use media/youtube
MAIN() {
local URLS=($@)
[[ ${#URLS[@]} -eq 0 ]] && URLS=($(echo '' | FZF_HEAD 'enter URL'))
[[ ${#URLS[@]} -eq 0 ]] && URLS=($(echo '' | FZF_USER_INPUT 'enter URL'))
[[ ${#URLS[@]} -eq 0 ]] && ABORT
local FILENAME=$(YT__GET_FILENAME $URLS)
@ -21,9 +21,9 @@ MAIN() {
LENGTH=$(GET_VIDEO_LENGTH "$INPUT_FILE")
[ ! $LENGTH ] && { ERROR "unable to determine video length for '$INPUT_FILE'"; return 2; }
START_TIME=$(echo 0 | FZF_HEAD "enter start time (0 ≤ t < $LENGTH)")
START_TIME=$(echo 0 | FZF_USER_INPUT "enter start time (0 ≤ t < $LENGTH)")
[ ! $START_TIME ] && ABORT
END_TIME=$(echo $LENGTH | FZF_HEAD "enter end time ($START_TIME > t ≥ $LENGTH)")
END_TIME=$(echo $LENGTH | FZF_USER_INPUT "enter end time ($START_TIME > t ≥ $LENGTH)")
[ ! $END_TIME ] && ABORT
STATUS
@ -32,7 +32,7 @@ MAIN() {
STATUS "end time : $END_TIME"
STATUS
OUTPUT_FILE=$(echo '' \
| FZF_HEAD 'what should I call this clip? (.mp3)' \
| FZF_USER_INPUT 'what should I call this clip? (.mp3)' \
| sed 's/\.mp3$//' \
)
[ ! $OUTPUT_FILE ] && ABORT

View File

@ -3,7 +3,7 @@ use office/memo
#####################################################################
MAIN() {
local MEMO_NAME=$(MEMO__LIST_ALL | FZF_TAIL 'select/create a memo')
local MEMO_NAME=$(MEMO__LIST_ALL | FZF_USER_INPUT 'select/create a memo')
[ ! "$MEMO_NAME" ] && ABORT
MEMO_FILE="$MEMO__DIR/$MEMO_NAME.$MEMO__FILETYPE"

View File

@ -10,7 +10,7 @@ MAIN() {
STATUS "selected '$TEMPLATE_ENV_NAME'"
PROMPT 'enter new environment name'
ENV_NAME=$(echo '' | FZF_HEAD 'new environment')
ENV_NAME=$(echo '' | FZF_USER_INPUT 'new environment')
[ ! $ENV_NAME ] && ABORT
SCWRYPTS__GET_ENV_NAMES | grep -q $ENV_NAME && FAIL 1 "'$ENV_NAME' already exists"