Skip to content

Commit e0532f2

Browse files
committed
fix: Improve completions, printf calls
1 parent c17ebdd commit e0532f2

File tree

8 files changed

+19
-11
lines changed

8 files changed

+19
-11
lines changed

completions/_bpm.zsh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ _1st_arguments=(
88
'link:Link a local package'
99
'list:List packages'
1010
'package-path:Print the full path of a package'
11+
'prune:Prune all packages'
1112
'remove:Uninstall a package'
1213
'upgrade:[TASK] Upgrade a package'
13-
'init:[box_name] [box_url] Initializes current folder for Vagrant usage'
14-
'--version:Prints the Vagrant version information'
14+
'--version:Print version'
1515
'--global:Switch to global dependency management'
1616
'--help:Show help'
1717
)
@@ -59,6 +59,8 @@ case $state in
5959
_describe -t commands "gem subcommand" subcommandOptions
6060
;;
6161
(remove)
62+
local -a subcommandOptions=(--all)
63+
_describe -t commands "gem subcommand" subcommandOptions
6264
;;
6365
(upgrade)
6466
local subcommandOptions=()

completions/bpm.bash

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ _bpm() {
8080
readarray -t COMPREPLY < <(IFS=' ' compgen -W "${subcommandOptions[*]}" -- "$currentWord")
8181
;;
8282
remove)
83+
subcommandOptions=(--all)
84+
readarray -t COMPREPLY < <(IFS=' ' compgen -W "${subcommandOptions[*]}" -- "$currentWord")
8385
;;
8486
upgrade)
8587
readarray -t subcommandOptions < <(bpm complete package-path)

completions/bpm.fish

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ set subcmd package-path
3232
set -l subcommandOptions
3333
complete -c $cmd -f -n "__fish_seen_subcommand_from $subcmd" -a "$subcommandOptions (bpm complete package-path)"
3434

35+
set subcmd remove
36+
set -l subcommandOptions --all
37+
complete -c $cmd -f -n "__fish_seen_subcommand_from $subcmd" -a "$subcommandOptions (bpm complete upgrade)"
38+
3539
set subcmd upgrade
3640
set -l subcommandOptions
3741
# TODO: only complete if (bpm complete upgrade) was successfull

pkg/lib/commands/do-plumbing-clone.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ do-plumbing-clone() {
2727
git_args+=("$uri")
2828
git_args+=("$BPM_PACKAGES_PATH/$id")
2929

30-
printf '%s\n' " -> Cloning Git repository"
30+
printf ' -> %s\n' "Cloning Git repository"
3131
local git_output=
3232
if ! git_output="$(git clone "${git_args[@]}" 2>&1)"; then
3333
log.error "Could not clone repository"

pkg/lib/commands/do-remove.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ do_actual_removal() {
7373
do-plumbing-unlink-completions "$id"
7474

7575
if [ "${id%%/*}" = 'local' ]; then
76-
printf '%s\n' " -> Unsymlinking directory"
76+
printf ' -> %s\n' "Unsymlinking directory"
7777
unlink "$BPM_PACKAGES_PATH/$id"
7878
else
79-
printf '%s\n' " -> Removing Git repository"
79+
printf ' -> %s\n' "Removing Git repository"
8080
rm -rf "${BPM_PACKAGES_PATH:?}/$id"
8181
if ! rmdir -p "${BPM_PACKAGES_PATH:?}/${id%/*}" &>/dev/null; then
8282
# Do not exit on "failure"

pkg/lib/util/abstract-bins.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ abstract.bins_do_action() {
104104
abstract_bins_did='yes'
105105

106106
case "$action" in
107-
link) printf '%s\n' " -> Linking bin files" ;;
108-
unlink) printf '%s\n' " -> Unlinking bin files" ;;
107+
link) printf ' -> %s\n' "Linking bin files" ;;
108+
unlink) printf ' -> %s\n' "Unlinking bin files" ;;
109109
esac
110110
fi
111111

pkg/lib/util/abstract-completions.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ abstract.completions_do_echo() {
225225
abstract_completions_did=yes
226226

227227
case "$action" in
228-
link) printf '%s\n' " -> Linking completion files" ;;
229-
unlink) printf '%s\n' " -> Unlinking completion files" ;;
228+
link) printf ' -> %s\n' "Linking completion files" ;;
229+
unlink) printf ' -> %s\n' "Unlinking completion files" ;;
230230
esac
231231
fi
232232
}

pkg/lib/util/abstract-mans.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ abstract.mans_do_action() {
8989
abstract_mans_did=yes
9090

9191
case "$action" in
92-
link) printf '%s\n' " -> Linking man files" ;;
93-
unlink) printf '%s\n' " -> Unlinking man files" ;;
92+
link) printf ' -> %s\n' "Linking man files" ;;
93+
unlink) printf ' -> %s\n' "Unlinking man files" ;;
9494
esac
9595
fi
9696

0 commit comments

Comments
 (0)