Skip to content

Commit 2059dc0

Browse files
committed
BREAKING CHANGE: Replace 'install/uninstall' with 'add/remove'
This was done because install and uninstall are long to type, and in my opinion the words 'add' and 'remove' have a better aesthetic
1 parent 95a1cf2 commit 2059dc0

File tree

12 files changed

+57
-57
lines changed

12 files changed

+57
-57
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Let's say you want to install [rupa/z](https://github.com/rupa/z), [tj/git-extras](https://github.com/tj/git-extras), [aristocratos/bashtop](https://github.com/aristocratos/bashtop), and [JosefZIla/bash2048](https://github.com/JosefZIla/bash2048). Simply run the following (as you can see, many formats are supported)
1010

1111
```sh
12-
$ bpm install \
12+
$ bpm add \
1313
rupa/z \
1414
github.com/tj/git-extras \
1515
https://github.com/aristocratos/bashtop \

docs/recepies.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
### Installing a package from Github
44

55
```sh
6-
bpm install sstephenson/bats
6+
bpm add sstephenson/bats
77
```
88

99
This will install [Bats](https://github.com/sstephenson/bats) and add its `./bin` to the `PATH`.
1010

1111
### Installing packages from other sites
1212

1313
```sh
14-
bpm install bitbucket.org/user/repo_name
14+
bpm add bitbucket.org/user/repo_name
1515
```
1616

1717
This will install `repo_name` from https://bitbucket.org/user/repo_name

pkg/completions/bpm.bash

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
_bpm() {
22
local -ra listPreSubcommandOptions=(--help --version)
3-
local -ra listSubcommands=(echo init install link list package-path uninstall upgrade)
3+
local -ra listSubcommands=(add echo init link list package-path remove upgrade)
44

55
local -r currentWord="${COMP_WORDS[COMP_CWORD]}"
66

@@ -55,6 +55,10 @@ _bpm() {
5555
elif (( COMP_CWORD > subcommandIndex )); then
5656
local -a subcommandOptions=()
5757
case "$subcommand" in
58+
add)
59+
subcommandOptions=(--ssh)
60+
readarray -t COMPREPLY < <(IFS=' ' compgen -W "${subcommandOptions[*]}" -- "$currentWord")
61+
;;
5862
echo)
5963
subcommandOptions=(BPM_ROOT BPM_PREFIX)
6064
readarray -t COMPREPLY < <(IFS=' ' compgen -W "${subcommandOptions[*]}" -- "$currentWord")
@@ -63,10 +67,6 @@ _bpm() {
6367
subcommandOptions=(sh bash zsh fish)
6468
readarray -t COMPREPLY < <(IFS=' ' compgen -W "${subcommandOptions[*]}" -- "$currentWord")
6569
;;
66-
install)
67-
subcommandOptions=(--ssh)
68-
readarray -t COMPREPLY < <(IFS=' ' compgen -W "${subcommandOptions[*]}" -- "$currentWord")
69-
;;
7070
link)
7171
subcommandOptions=(--no-deps)
7272
readarray -t COMPREPLY < <(IFS=' ' compgen -W "${subcommandOptions[*]}" -- "$currentWord")
@@ -79,7 +79,7 @@ _bpm() {
7979
readarray -t subcommandOptions < <(bpm complete package-path)
8080
readarray -t COMPREPLY < <(IFS=' ' compgen -W "${subcommandOptions[*]}" -- "$currentWord")
8181
;;
82-
uninstall)
82+
remove)
8383
;;
8484
upgrade)
8585
readarray -t subcommandOptions < <(bpm complete package-path)

pkg/lib/cmd/bpm.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ main() {
3434
done
3535

3636
case "$1" in
37+
add)
38+
shift
39+
do-add "$@"
40+
;;
3741
complete)
3842
shift
3943
do-complete "$@"
@@ -46,10 +50,6 @@ main() {
4650
shift
4751
do-init "$@"
4852
;;
49-
install)
50-
shift
51-
do-install "$@"
52-
;;
5353
link)
5454
shift
5555
do-link "$@"
@@ -66,9 +66,9 @@ main() {
6666
shift
6767
bpm-package-path "$@"
6868
;;
69-
uninstall)
69+
remove)
7070
shift
71-
do-uninstall "$@"
71+
do-remove "$@"
7272
;;
7373
upgrade)
7474
shift

pkg/lib/commands/do-install.sh renamed to pkg/lib/commands/do-add.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# shellcheck shell=bash
22

3-
do-install() {
3+
do-add() {
44
local with_ssh='no'
55

66
local -a pkgs=()

pkg/lib/commands/do-complete.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ do-complete() {
55
package-path)
66
do-list
77
;;
8-
uninstall)
8+
remove)
99
do-list
1010
;;
1111
upgrade)

pkg/lib/commands/do-plumbing-add-deps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ do-plumbing-add-deps() {
2828

2929
log.info "Installing dependencies for '$package'"
3030
for dep in "${deps[@]}"; do
31-
do-install "$dep"
31+
do-add "$dep"
3232
done
3333
}

pkg/lib/commands/do-uninstall.sh renamed to pkg/lib/commands/do-remove.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# shellcheck shell=bash
22

3-
do-uninstall() {
3+
do-remove() {
44
if (( $# == 0 )); then
55
die "You must supply at least one package"
66
fi
@@ -15,15 +15,15 @@ do-uninstall() {
1515
local user="${fullPath%/*}"; user="${user##*/}"
1616
local repository="${fullPath##*/}"
1717
if [ "$fullPath" = "$BPM_PACKAGES_PATH/$user/$repository" ]; then
18-
do_actual_uninstall "$user/$repository"
18+
do_actual_removal "$user/$repository"
1919
fi
2020
else
2121
local site= user= repository= ref=
2222
util.parse_package_full "$repoSpec"
2323
IFS=':' read -r site user repository ref <<< "$REPLY"
2424

2525
if [ -d "$BPM_PACKAGES_PATH/$user/$repository" ]; then
26-
do_actual_uninstall "$user/$repository"
26+
do_actual_removal "$user/$repository"
2727
elif [ -e "$BPM_PACKAGES_PATH/$user/$repository" ]; then
2828
rm -f "$BPM_PACKAGES_PATH/$user/$repository"
2929
else
@@ -33,7 +33,7 @@ do-uninstall() {
3333
done
3434
}
3535

36-
do_actual_uninstall() {
36+
do_actual_removal() {
3737
local package="$1"
3838

3939
log.info "Uninstalling '$package'"

pkg/lib/util/util.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@ Subcommands:
234234
init <shell>
235235
Configure shell environment for Basher
236236
237-
install [--ssh] [[site/]<package>[@ref]...]
237+
add [--ssh] [[site/]<package>[@ref]...]
238238
Installs a package from GitHub (or a custom site)
239239
240-
uninstall <package...>
240+
remove <package...>
241241
Uninstalls a package
242242
243243
link [--no-deps] <directory...>
@@ -257,9 +257,9 @@ Subcommands:
257257
Perform the completion for a particular subcommand. Used by the completion scripts
258258
259259
Examples:
260-
bpm install tj/git-extras
261-
bpm install github.com/tj/git-extras
262-
bpm install https://github.com/tj/git-extras
263-
bpm install git@github.com:tj/git-extras
260+
bpm add tj/git-extras
261+
bpm add github.com/tj/git-extras
262+
bpm add https://github.com/tj/git-extras
263+
bpm add git@github.com:tj/git-extras
264264
EOF
265265
}

tests/do-install.bats

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ load 'util/init.sh'
99
test_util.mock_command do-plumbing-link-completions
1010
test_util.mock_command do-plumbing-link-man
1111

12-
run do-install
12+
run do-add
1313

1414
assert_failure
1515
assert_line -n 0 -p "At least one package must be supplied"
@@ -22,7 +22,7 @@ load 'util/init.sh'
2222
test_util.mock_command do-plumbing-link-completions
2323
test_util.mock_command do-plumbing-link-man
2424

25-
run do-install username/package
25+
run do-add username/package
2626

2727
assert_success
2828
assert_line -n 0 -p "Installing 'username/package'"
@@ -40,7 +40,7 @@ load 'util/init.sh'
4040
test_util.mock_command do-plumbing-link-completions
4141
test_util.mock_command do-plumbing-link-man
4242

43-
run do-install username/package username2/package2
43+
run do-add username/package username2/package2
4444

4545
assert_success
4646
assert_line -n 0 -p "Installing 'username/package'"
@@ -65,7 +65,7 @@ load 'util/init.sh'
6565
test_util.mock_command do-plumbing-link-completions
6666
test_util.mock_command do-plumbing-link-man
6767

68-
run do-install https://gitlab.com/username/package
68+
run do-add https://gitlab.com/username/package
6969

7070
assert_success
7171
assert_line "do-plumbing-clone https://gitlab.com/username/package.git username/package"
@@ -78,7 +78,7 @@ load 'util/init.sh'
7878
test_util.mock_command do-plumbing-link-completions
7979
test_util.mock_command do-plumbing-link-man
8080

81-
run do-install http://gitlab.com/username/package
81+
run do-add http://gitlab.com/username/package
8282

8383
assert_success
8484
assert_line "do-plumbing-clone http://gitlab.com/username/package.git username/package"
@@ -91,7 +91,7 @@ load 'util/init.sh'
9191
test_util.mock_command do-plumbing-link-completions
9292
test_util.mock_command do-plumbing-link-man
9393

94-
run do-install site/username/package
94+
run do-add site/username/package
9595

9696
assert_success
9797
assert_line "do-plumbing-clone https://site/username/package.git username/package"
@@ -104,7 +104,7 @@ load 'util/init.sh'
104104
test_util.mock_command do-plumbing-link-completions
105105
test_util.mock_command do-plumbing-link-man
106106

107-
run do-install username/package
107+
run do-add username/package
108108

109109
assert_success
110110
assert_line "do-plumbing-clone https://github.com/username/package.git username/package"
@@ -117,7 +117,7 @@ load 'util/init.sh'
117117
test_util.mock_command do-plumbing-link-completions
118118
test_util.mock_command do-plumbing-link-man
119119

120-
run do-install --ssh username/package
120+
run do-add --ssh username/package
121121

122122
assert_success
123123
assert_line "do-plumbing-clone git@github.com:username/package.git username/package"
@@ -130,7 +130,7 @@ load 'util/init.sh'
130130
test_util.mock_command do-plumbing-link-completions
131131
test_util.mock_command do-plumbing-link-man
132132

133-
run do-install username/package --ssh
133+
run do-add username/package --ssh
134134

135135
assert_success
136136
assert_line "do-plumbing-clone git@github.com:username/package.git username/package"
@@ -143,7 +143,7 @@ load 'util/init.sh'
143143
test_util.mock_command do-plumbing-link-completions
144144
test_util.mock_command do-plumbing-link-man
145145

146-
run do-install git@github.com:username/package
146+
run do-add git@github.com:username/package
147147

148148
assert_success
149149
assert_line "do-plumbing-clone git@github.com:username/package.git username/package"
@@ -156,7 +156,7 @@ load 'util/init.sh'
156156
test_util.mock_command do-plumbing-link-completions
157157
test_util.mock_command do-plumbing-link-man
158158

159-
run do-install username/package@v1.2.3
159+
run do-add username/package@v1.2.3
160160

161161
assert_success
162162
assert_line "do-plumbing-clone https://github.com/username/package.git username/package v1.2.3"
@@ -169,7 +169,7 @@ load 'util/init.sh'
169169
test_util.mock_command do-plumbing-link-completions
170170
test_util.mock_command do-plumbing-link-man
171171

172-
run do-install username/package@
172+
run do-add username/package@
173173

174174
assert_success
175175
assert_line "do-plumbing-clone https://github.com/username/package.git username/package"

0 commit comments

Comments
 (0)