|
@@ -13,7 +13,7 @@ ffoo import pretty
|
13
|
13
|
FFOO_INIGREP_SUFFIX="${FFOO_INIGREP_SUFFIX:-.ini}"
|
14
|
14
|
|
15
|
15
|
|
16
|
|
-__inigrep__cat() {
|
|
16
|
+_inigrep__cat() {
|
17
|
17
|
#
|
18
|
18
|
# cat without starting a process
|
19
|
19
|
#
|
|
@@ -22,7 +22,7 @@ __inigrep__cat() {
|
22
|
22
|
}
|
23
|
23
|
|
24
|
24
|
|
25
|
|
-__inigrep__fltcmt() {
|
|
25
|
+_inigrep__fltcmt() {
|
26
|
26
|
#
|
27
|
27
|
# Just strip comments
|
28
|
28
|
#
|
|
@@ -30,7 +30,7 @@ __inigrep__fltcmt() {
|
30
|
30
|
}
|
31
|
31
|
|
32
|
32
|
|
33
|
|
-__inigrep__fltkey() {
|
|
33
|
+_inigrep__fltkey() {
|
34
|
34
|
#
|
35
|
35
|
# Filter values from `key = value pairs`
|
36
|
36
|
#
|
|
@@ -49,7 +49,7 @@ __inigrep__fltkey() {
|
49
|
49
|
}
|
50
|
50
|
|
51
|
51
|
|
52
|
|
-__inigrep__fltsct() {
|
|
52
|
+_inigrep__fltsct() {
|
53
|
53
|
#
|
54
|
54
|
# Filter out only the wanted section body
|
55
|
55
|
#
|
|
@@ -72,7 +72,7 @@ __inigrep__fltsct() {
|
72
|
72
|
}
|
73
|
73
|
|
74
|
74
|
|
75
|
|
-__inigrep__fltlst() {
|
|
75
|
+_inigrep__fltlst() {
|
76
|
76
|
#
|
77
|
77
|
# Filter only section/keys/path names from the stream
|
78
|
78
|
#
|
|
@@ -100,7 +100,7 @@ __inigrep__fltlst() {
|
100
|
100
|
}
|
101
|
101
|
|
102
|
102
|
|
103
|
|
-__inigrep__merge() {
|
|
103
|
+_inigrep__merge() {
|
104
|
104
|
#
|
105
|
105
|
# Take paths and applying merge strategy, load file(s)
|
106
|
106
|
#
|
|
@@ -125,11 +125,11 @@ __inigrep__merge() {
|
125
|
125
|
}
|
126
|
126
|
|
127
|
127
|
|
128
|
|
-__inigrep__load() {
|
|
128
|
+_inigrep__load() {
|
129
|
129
|
#
|
130
|
130
|
# Find file(s) candidates and load them (or use *__merge)
|
131
|
131
|
#
|
132
|
|
- test -n "$1" || __inigrep__load "${wntsct%%.*}$FFOO_INIGREP_SUFFIX"
|
|
132
|
+ test -n "$1" || _inigrep__load "${wntsct%%.*}$FFOO_INIGREP_SUFFIX"
|
133
|
133
|
local arg trydir trypath
|
134
|
134
|
for arg in "$@";
|
135
|
135
|
do
|
|
@@ -149,7 +149,7 @@ __inigrep__load() {
|
149
|
149
|
debug -v trypath
|
150
|
150
|
echos "$trypath"
|
151
|
151
|
done \
|
152
|
|
- | __inigrep__merge
|
|
152
|
+ | _inigrep__merge
|
153
|
153
|
;;
|
154
|
154
|
esac
|
155
|
155
|
done
|
|
@@ -298,22 +298,22 @@ inigrep() {
|
298
|
298
|
s|sections) : ;;
|
299
|
299
|
*) warn "invalid object type to list: $listobj"; return 2 ;;
|
300
|
300
|
esac
|
301
|
|
- fltsct=__inigrep__cat # section filter
|
302
|
|
- fltkey=__inigrep__cat # key filter
|
303
|
|
- fltcmt=__inigrep__fltcmt # comment filter
|
304
|
|
- fltlst=__inigrep__cat # listing mode filter
|
305
|
|
- limit_line=__inigrep__cat # limiter filter
|
306
|
|
- test -n "$wntsct" && fltsct=__inigrep__fltsct
|
307
|
|
- test -n "$wntkey" && fltkey=__inigrep__fltkey
|
308
|
|
- $list && fltlst=__inigrep__fltlst
|
|
301
|
+ fltsct=_inigrep__cat # section filter
|
|
302
|
+ fltkey=_inigrep__cat # key filter
|
|
303
|
+ fltcmt=_inigrep__fltcmt # comment filter
|
|
304
|
+ fltlst=_inigrep__cat # listing mode filter
|
|
305
|
+ limit_line=_inigrep__cat # limiter filter
|
|
306
|
+ test -n "$wntsct" && fltsct=_inigrep__fltsct
|
|
307
|
+ test -n "$wntkey" && fltkey=_inigrep__fltkey
|
|
308
|
+ $list && fltlst=_inigrep__fltlst
|
309
|
309
|
$one_line && limit_line="tail -1"
|
310
|
310
|
$strict && grepex=""
|
311
|
|
- $strict && fltcmt=__inigrep__cat
|
|
311
|
+ $strict && fltcmt=_inigrep__cat
|
312
|
312
|
debug -v wntkey wntsct list listobj
|
313
|
313
|
debug "\$@='$@'"
|
314
|
314
|
local restore_extglob=$(shopt -p extglob)
|
315
|
315
|
shopt -s extglob
|
316
|
|
- __inigrep__load "$@" \
|
|
316
|
+ _inigrep__load "$@" \
|
317
|
317
|
| $fltcmt \
|
318
|
318
|
| $fltsct \
|
319
|
319
|
| $fltkey \
|