File tree Expand file tree Collapse file tree 7 files changed +21
-5
lines changed
Expand file tree Collapse file tree 7 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 1- 2.5.0
1+ 2.5.1
Original file line number Diff line number Diff line change 99 "compile-hero.disable-compile-files-on-did-save-code" : true ,
1010 "shellcheck.enableQuickFix" : true ,
1111 "workbench.colorTheme" : " Popping and Locking" ,
12- "window.zoomLevel" : 0 ,
12+ "window.zoomLevel" : 1 ,
1313 "customPresentationMode.backup" : {},
1414 "gruvboxMaterial.jsson1Comments" : false ,
1515 "git-graph.markdown" : false
Original file line number Diff line number Diff line change 11[separator=—]
22= Bashmatic® — BASH-based DSL helpers for humans, sysadmins, and fun.
33// vim: ft=asciidoc
4- :author: Version v2.4.6
4+ :author: Version v2.5.0
55:doctype: book
66:source-highlighter: rouge
77:rouge-style: base16.monokai
Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ util.rot13() {
3434}
3535
3636alias rot13=util.rot13
37+ __grep=" ${GrepCommand/ */ } "
38+ [[ -n ${__grep} && -x ${__grep} ]] || {
39+ export GrepCommand=" $( command -v grep) -E"
40+ }
3741
3842util.is-variable-defined () {
3943 local var_name=" $1 "
@@ -211,11 +215,11 @@ util.functions-starting-with-csv() {
211215util.functions-matching () {
212216 local prefix=" ${1} "
213217 local extra_command=${2:- " cat" }
214- set | ${GrepCommand} ' ^${prefix}' | sedx ' s/[\(\)]//g;' | /usr/bin/tr -d ' ' | /usr/bin/tr ' \n' ' '
218+ declare -f | ${GrepCommand} " ^${prefix} " | sedx ' s/[\(\)]//g;' | /usr/bin/tr -d ' ' | /usr/bin/tr ' \n' ' '
215219}
216220
217221util.functions-matching.diff () {
218- for m in " $@ " ; do
222+ while true ; do
219223 [[ -z " $1 " ]] && break
220224 for e in $( util.functions-matching " ${1} " ) ; do
221225 printf " ${e/ $1 / } \n"
Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ load test_helper
55source lib/util.sh
66source lib/user.sh
77source lib/is.sh
8+ source lib/db.sh
9+ source lib/db_cli.sh
10+ source lib/db_rails.sh
11+ source lib/db_top.sh
812
913set -e
1014
@@ -67,3 +71,11 @@ moo() {
6771 set -e
6872 [ $code -ne 0 ]
6973}
74+
75+ @test " util.functions-matching.diff" {
76+ set -e
77+ local -a actions=($( util.functions-matching.diff db.actions. | sort) )
78+ local num=${# actions[@]}
79+ [[ $num -gt 10 ]] &&
80+ [[ " ${actions[0]} " == " commands" ]]
81+ }
You can’t perform that action at this time.
0 commit comments