From b6b4f2e5b86c065e96674567e30fa8cd6c341ee9 Mon Sep 17 00:00:00 2001 From: yage Date: Mon, 12 Feb 2024 23:44:43 -0700 Subject: [PATCH] FZF_(HEAD|TAIL) refactor to FZF_USER_INPUT --- zsh/lib/scwrypts/environment-files.module.zsh | 2 +- zsh/media/youtube/download | 2 +- zsh/media/youtube/get-audio-clip | 8 ++++---- zsh/office/memo/open | 2 +- zsh/scwrypts/environment/copy | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/zsh/lib/scwrypts/environment-files.module.zsh b/zsh/lib/scwrypts/environment-files.module.zsh index 060bfe8..eda68d5 100644 --- a/zsh/lib/scwrypts/environment-files.module.zsh +++ b/zsh/lib/scwrypts/environment-files.module.zsh @@ -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() { diff --git a/zsh/media/youtube/download b/zsh/media/youtube/download index 0ac100c..eaeac2f 100755 --- a/zsh/media/youtube/download +++ b/zsh/media/youtube/download @@ -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) diff --git a/zsh/media/youtube/get-audio-clip b/zsh/media/youtube/get-audio-clip index 1edb8c0..3294303 100755 --- a/zsh/media/youtube/get-audio-clip +++ b/zsh/media/youtube/get-audio-clip @@ -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 diff --git a/zsh/office/memo/open b/zsh/office/memo/open index ec0ff51..83aaf89 100755 --- a/zsh/office/memo/open +++ b/zsh/office/memo/open @@ -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" diff --git a/zsh/scwrypts/environment/copy b/zsh/scwrypts/environment/copy index 4198ddf..1d13045 100755 --- a/zsh/scwrypts/environment/copy +++ b/zsh/scwrypts/environment/copy @@ -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"