Skip to content

Commit d9c0fc6

Browse files
committed
- Add --force and --verbose to 'rush get' command
1 parent d3ff528 commit d9c0fc6

27 files changed

+167
-88
lines changed

rush

Lines changed: 95 additions & 67 deletions
Large diffs are not rendered by default.

sample-repo/hello/main

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ echo "What's the rush?"
33
echo "REPO: $REPO"
44
echo "REPO_PATH: $REPO_PATH"
55
echo "USER_CWD: $USER_CWD"
6+
echo "VERBOSE: $VERBOSE"
7+
echo "FORCE: $FORCE"

src/bashly.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,18 @@ commands:
188188
Clone the repository if it is not found locally.
189189
This flag will look for a GitHub user with the same name as the
190190
repository, and attempt to clone their rush-repo repository.
191+
- long: --force
192+
short: -f
193+
help: |-
194+
Force installation.
195+
This may mean different things in different packages.
196+
- long: --verbose
197+
short: -v
198+
help: Show additional details if possible.
191199

192200
examples:
193201
- rush ruby
194-
- rush get ruby
202+
- rush get ruby --force
195203
- rush get centos:ruby
196204

197205
- name: undo

src/get_command.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
package=${args[package]}
33
repo="default"
44
clone=${args[--clone]}
5+
export FORCE=${args['--force']}
6+
export VERBOSE=${args['--verbose']}
57

68
if [[ $package =~ (.*):(.*) ]]; then
79
repo=${BASH_REMATCH[1]}

src/lib/send_completions.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ send_completions() {
107107
echo $' ;;'
108108
echo $''
109109
echo $' \'get\'*)'
110-
echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --clone --help -c -h")" -- "$cur" )'
110+
echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --clone --force --help --verbose -c -f -h -v")" -- "$cur" )'
111111
echo $' ;;'
112112
echo $''
113113
echo $' \'a\'*)'
@@ -127,7 +127,7 @@ send_completions() {
127127
echo $' ;;'
128128
echo $''
129129
echo $' \'g\'*)'
130-
echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --clone --help -c -h")" -- "$cur" )'
130+
echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --clone --force --help --verbose -c -f -h -v")" -- "$cur" )'
131131
echo $' ;;'
132132
echo $''
133133
echo $' \'u\'*)'

test/approvals/rush

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
rush - Personal package manager
22

33
Usage:
4-
rush [command]
5-
rush [command] --help | -h
4+
rush COMMAND
5+
rush [COMMAND] --help | -h
66
rush --version | -v
77

88
Repository Commands:

test/approvals/rush_clone

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
missing required argument: GITHUB_USER
2-
usage: rush clone GITHUB_USER [PATH] [options]
2+
usage: rush clone GITHUB_USER [PATH] [OPTIONS]

test/approvals/rush_clone_h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ rush clone
55
configuration file.
66

77
Usage:
8-
rush clone GITHUB_USER [PATH] [options]
8+
rush clone GITHUB_USER [PATH] [OPTIONS]
99
rush clone --help | -h
1010

1111
Options:

test/approvals/rush_completions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ _rush_completions() {
105105
;;
106106

107107
'get'*)
108-
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --clone --help -c -h")" -- "$cur" )
108+
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --clone --force --help --verbose -c -f -h -v")" -- "$cur" )
109109
;;
110110

111111
'a'*)
@@ -125,7 +125,7 @@ _rush_completions() {
125125
;;
126126

127127
'g'*)
128-
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --clone --help -c -h")" -- "$cur" )
128+
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_rush_completions_filter "$(rush list -s -a) --clone --force --help --verbose -c -f -h -v")" -- "$cur" )
129129
;;
130130

131131
'u'*)

test/approvals/rush_config_h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ rush config - Show or edit the configuration file
33
Alias: c
44

55
Usage:
6-
rush config [options]
6+
rush config [OPTIONS]
77
rush config --help | -h
88

99
Options:

0 commit comments

Comments
 (0)