Skip to content

Commit d7baefa

Browse files
committed
- Add titles to search output sections
1 parent a8b9d55 commit d7baefa

File tree

7 files changed

+33
-3
lines changed

7 files changed

+33
-3
lines changed

op.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ generate: bashly generate
77
test: docker-compose run --rm test
88
#? run tests in a container
99

10-
shellcheck: shellcheck rush
10+
shellcheck: shellcheck rush && echo "PASS"
1111
#? run shellcheck tests
1212

1313
version: \

rush

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,10 +1329,12 @@ rush_search_command() {
13291329
[[ "$repo" != "default" ]] && prefix="$repo:"
13301330

13311331
# Search directories matching search text
1332+
blue "Matching packages:\n"
13321333
find "$repo_path" -type d -not -path '*/\.*' | grep --color=always "$text" | \
13331334
sed "s#${repo_path}/#${prefix}#g" | sed 's#/info##'
13341335

13351336
# Search info files matching search text
1337+
blue "\nMatching info files:\n"
13361338
grep --color=always --initial-tab --recursive --ignore-case --include "info" \
13371339
"$text" "$repo_path" | \
13381340
sort | \
@@ -2376,7 +2378,7 @@ rush_edit_parse_requirements() {
23762378

23772379
# :command.initialize
23782380
initialize() {
2379-
version="0.5.8"
2381+
version="0.5.9"
23802382
long_usage=''
23812383
set -e
23822384

src/bashly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: rush
22
help: Personal package manager
3-
version: 0.5.8
3+
version: 0.5.9
44

55
environment_variables:
66
- name: rush_config

src/search_command.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ search_repo() {
1010
[[ "$repo" != "default" ]] && prefix="$repo:"
1111

1212
# Search directories matching search text
13+
blue "Matching packages:\n"
1314
find "$repo_path" -type d -not -path '*/\.*' | grep --color=always "$text" | \
1415
sed "s#${repo_path}/#${prefix}#g" | sed 's#/info##'
1516

1617
# Search info files matching search text
18+
blue "\nMatching info files:\n"
1719
grep --color=always --initial-tab --recursive --ignore-case --include "info" \
1820
"$text" "$repo_path" | \
1921
sort | \

test/approvals/rush_search_hello

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Matching packages:
2+

3+
hello
4+

5+
Matching info files:
6+

7+
hello: $ rush info hello
8+
9+
Matching packages:
10+

11+
sample:hello
12+

13+
Matching info files:
14+

15+
sample:hello: $ rush info hello

test/approvals/rush_search_running

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
Matching packages:
2+

3+

4+
Matching info files:
5+

16
hello: This info file can be accessed by running
27
nested/hi: This info file can be accessed by running
38

9+
Matching packages:
10+

11+

12+
Matching info files:
13+

414
sample:hello: This info file can be accessed by running
515
sample:nested/hi: This info file can be accessed by running

test/approve

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ describe "search"
115115
approve "rush search"
116116
approve "rush search -h"
117117
approve "rush search running"
118+
approve "rush search hello"
118119
apk del grep >/dev/null 2>&1
119120
approve "rush search busybox-error"
120121

0 commit comments

Comments
 (0)