fpf-cli 1.6.31 → 1.6.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/fpf +25 -6
- package/package.json +1 -1
package/README.md
CHANGED
package/fpf
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
set -euo pipefail
|
|
4
4
|
|
|
5
5
|
SCRIPT_NAME="fpf"
|
|
6
|
-
SCRIPT_VERSION="1.6.
|
|
6
|
+
SCRIPT_VERSION="1.6.33"
|
|
7
7
|
TMP_ROOT="${TMPDIR:-/tmp}/fpf"
|
|
8
8
|
SESSION_TMP_ROOT=""
|
|
9
9
|
HELP_FILE=""
|
|
@@ -90,12 +90,17 @@ fzf_command_available() {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
assume_yes_enabled() {
|
|
93
|
+
local env_assume_yes=""
|
|
94
|
+
|
|
93
95
|
if [[ "${ASSUME_YES}" == "1" ]]; then
|
|
94
96
|
return 0
|
|
95
97
|
fi
|
|
96
98
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
env_assume_yes="$(trim_whitespace "${FPF_ASSUME_YES:-0}")"
|
|
100
|
+
env_assume_yes="$(printf "%s" "${env_assume_yes}" | tr '[:upper:]' '[:lower:]')"
|
|
101
|
+
|
|
102
|
+
case "${env_assume_yes}" in
|
|
103
|
+
1|true|yes|on)
|
|
99
104
|
return 0
|
|
100
105
|
;;
|
|
101
106
|
*)
|
|
@@ -1604,6 +1609,8 @@ print_version() {
|
|
|
1604
1609
|
}
|
|
1605
1610
|
|
|
1606
1611
|
parse_args() {
|
|
1612
|
+
local manager_value=""
|
|
1613
|
+
|
|
1607
1614
|
while (($#)); do
|
|
1608
1615
|
case "$1" in
|
|
1609
1616
|
-h|--help)
|
|
@@ -1687,7 +1694,16 @@ parse_args() {
|
|
|
1687
1694
|
-m|--manager)
|
|
1688
1695
|
shift
|
|
1689
1696
|
[[ $# -gt 0 ]] || die "Missing value for --manager"
|
|
1690
|
-
|
|
1697
|
+
manager_value="$(trim_whitespace "$1")"
|
|
1698
|
+
[[ -n "${manager_value}" ]] || die "Missing value for --manager"
|
|
1699
|
+
[[ "${manager_value}" != -* ]] || die "Missing value for --manager"
|
|
1700
|
+
MANAGER_OVERRIDE="$(normalize_manager "${manager_value}")"
|
|
1701
|
+
;;
|
|
1702
|
+
-m=*|--manager=*)
|
|
1703
|
+
manager_value="$(trim_whitespace "${1#*=}")"
|
|
1704
|
+
[[ -n "${manager_value}" ]] || die "Missing value for --manager"
|
|
1705
|
+
[[ "${manager_value}" != -* ]] || die "Missing value for --manager"
|
|
1706
|
+
MANAGER_OVERRIDE="$(normalize_manager "${manager_value}")"
|
|
1691
1707
|
;;
|
|
1692
1708
|
--)
|
|
1693
1709
|
shift
|
|
@@ -3005,6 +3021,7 @@ manager_refresh() {
|
|
|
3005
3021
|
confirm_action() {
|
|
3006
3022
|
local prompt="$1"
|
|
3007
3023
|
local reply=""
|
|
3024
|
+
local normalized_reply=""
|
|
3008
3025
|
|
|
3009
3026
|
if assume_yes_enabled; then
|
|
3010
3027
|
return 0
|
|
@@ -3012,9 +3029,11 @@ confirm_action() {
|
|
|
3012
3029
|
|
|
3013
3030
|
printf "%s [y/N]: " "${prompt}" >&2
|
|
3014
3031
|
read -r reply || true
|
|
3032
|
+
reply="$(trim_whitespace "${reply}")"
|
|
3033
|
+
normalized_reply="$(printf "%s" "${reply}" | tr '[:upper:]' '[:lower:]')"
|
|
3015
3034
|
|
|
3016
|
-
case "${
|
|
3017
|
-
y|
|
|
3035
|
+
case "${normalized_reply}" in
|
|
3036
|
+
y|yes)
|
|
3018
3037
|
return 0
|
|
3019
3038
|
;;
|
|
3020
3039
|
*)
|