@@ -2,35 +2,35 @@ Go Replace tests:
22
33 $ CURRENT="$(pwd)"
44 $ cd "$TESTDIR/../"
5- $ go build -o goreplace
5+ $ go build -o go-replace
66 $ cd "$CURRENT"
7- $ alias goreplace ="$TESTDIR/../goreplace "
7+ $ alias go-replace ="$TESTDIR/../go-replace "
88
99Usage:
1010
11- $ goreplace -h > /dev/null
11+ $ go-replace -h > /dev/null
1212 [1]
13- $ goreplace -V
14- goreplace version [0-9]+.[0-9]+.[0-9]+ (re)
13+ $ go-replace -V
14+ go-replace version [0-9]+.[0-9]+.[0-9]+ (re)
1515 Copyright \(C\) 20[0-9]{2} webdevops.io (re)
16- $ goreplace --dumpversion
16+ $ go-replace --dumpversion
1717 [0-9]+.[0-9]+.[0-9]+ (re)
1818
1919
2020Testing ignoring missing arguments:
2121
22- $ goreplace -s foobar -r ___xxx --ignore-empty
22+ $ go-replace -s foobar -r ___xxx --ignore-empty
2323
2424Testing missing search and replace argument:
2525
26- $ goreplace --mode=replace /dev/null
26+ $ go-replace --mode=replace /dev/null
2727 Error: Missing either --search or --replace for this mode
2828 Command: .* (re)
2929 [1]
3030
3131Testing ignoring missing arguments in template mode:
3232
33- $ goreplace --mode=template --ignore-empty
33+ $ go-replace --mode=template --ignore-empty
3434
3535
3636
@@ -42,7 +42,7 @@ Testing replace mode:
4242 > this is the third foobar line
4343 > this is the last line
4444 > EOF
45- $ goreplace -s foobar -r ___xxx test.txt
45+ $ go-replace -s foobar -r ___xxx test.txt
4646 $ cat test.txt
4747 this is a testline
4848 this is the second line
@@ -57,7 +57,7 @@ Testing replace mode with multiple changesets:
5757 > this is the third foobar line
5858 > this is the last oofrab line
5959 > EOF
60- $ goreplace -s foobar -r 111 -s barfoo -r 222 -s oofrab -r 333 test.txt
60+ $ go-replace -s foobar -r 111 -s barfoo -r 222 -s oofrab -r 333 test.txt
6161 $ cat test.txt
6262 this is a testline
6363 this is the second 222 line
@@ -72,7 +72,7 @@ Testing replace mode with stdin:
7272 > this is the third foobar line
7373 > this is the last line
7474 > EOF
75- $ cat test.txt | goreplace -s foobar -r ___xxx --stdin
75+ $ cat test.txt | go-replace -s foobar -r ___xxx --stdin
7676 this is a testline
7777 this is the second line
7878 this is the third ___xxx line
@@ -87,7 +87,7 @@ Testing replace mode with multiple matches:
8787 > this is the foobar forth foobar line
8888 > this is the last line
8989 > EOF
90- $ goreplace -s foobar -r ___xxx test.txt
90+ $ go-replace -s foobar -r ___xxx test.txt
9191 $ cat test.txt
9292 this is a testline
9393 this is the second line
@@ -104,7 +104,7 @@ Testing replace mode without match:
104104 > this is the foobar forth foobar line
105105 > this is the last line
106106 > EOF
107- $ goreplace -s barfoo -r ___xxx test.txt
107+ $ go-replace -s barfoo -r ___xxx test.txt
108108 $ cat test.txt
109109 this is a testline
110110 this is the second line
@@ -120,7 +120,7 @@ Testing replace mode with regex:
120120 > this is the third foobar line
121121 > this is the last line
122122 > EOF
123- $ goreplace --regex -s 'f[o]+b[a]*r' -r ___xxx test.txt
123+ $ go-replace --regex -s 'f[o]+b[a]*r' -r ___xxx test.txt
124124 $ cat test.txt
125125 this is a testline
126126 this is the second line
@@ -135,13 +135,13 @@ Testing replace mode with regex:
135135 > this is the third foobar line
136136 > this is the last line
137137 > EOF
138- $ goreplace --regex --regex-backrefs -s 'f[o]+(b[a]*r)' -r '___$1' test.txt
138+ $ go-replace --regex --regex-backrefs -s 'f[o]+(b[a]*r)' -r '___$1' test.txt
139139 $ cat test.txt
140140 this is a testline
141141 this is the second line
142142 this is the third ___bar line
143143 this is the last line
144- $ goreplace --regex --regex-backrefs -s 'not-existing-line' -r '___$1' test.txt
144+ $ go-replace --regex --regex-backrefs -s 'not-existing-line' -r '___$1' test.txt
145145 $ cat test.txt
146146 this is a testline
147147 this is the second line
@@ -156,7 +156,7 @@ Testing replace mode with regex and case-insensitive:
156156 > this is the third foobar line
157157 > this is the last line
158158 > EOF
159- $ goreplace --regex --regex-backrefs -s 'F[O]+(b[a]*r)' -r '___$1' --case-insensitive test.txt
159+ $ go-replace --regex --regex-backrefs -s 'F[O]+(b[a]*r)' -r '___$1' --case-insensitive test.txt
160160 $ cat test.txt
161161 this is a testline
162162 this is the second line
@@ -172,7 +172,7 @@ Testing line mode:
172172 > this is the third foobar line
173173 > this is the last line
174174 > EOF
175- $ goreplace --mode=line -s foobar -r ___xxx test.txt
175+ $ go-replace --mode=line -s foobar -r ___xxx test.txt
176176 $ cat test.txt
177177 this is a testline
178178 this is the second line
@@ -188,7 +188,7 @@ Testing line mode with multiple matches:
188188 > this is the foobar forth foobar line
189189 > this is the last line
190190 > EOF
191- $ goreplace --mode=line -s foobar -r ___xxx test.txt
191+ $ go-replace --mode=line -s foobar -r ___xxx test.txt
192192 $ cat test.txt
193193 this is a testline
194194 this is the second line
@@ -205,7 +205,7 @@ Testing line mode with multiple matches and --once:
205205 > this is the foobar forth foobar line
206206 > this is the last line
207207 > EOF
208- $ goreplace --mode=line -s foobar -r ___xxx --once test.txt
208+ $ go-replace --mode=line -s foobar -r ___xxx --once test.txt
209209 $ cat test.txt
210210 this is a testline
211211 this is the second line
@@ -222,7 +222,7 @@ Testing line mode with multiple matches and --once=unique:
222222 > this is the foobar forth foobar line
223223 > this is the last line
224224 > EOF
225- $ goreplace --mode=line -s foobar -r ___xxx --once=unique test.txt
225+ $ go-replace --mode=line -s foobar -r ___xxx --once=unique test.txt
226226 $ cat test.txt
227227 this is a testline
228228 this is the second line
@@ -245,7 +245,7 @@ Testing replace mode with path option:
245245 $ cp test.txt testing/sub2/subsub/test4.txt
246246 $ cp test.txt testing/sub2/subsub/test5.txt
247247 $ cp test.txt testing/sub2/original.md
248- $ goreplace -s foobar -r barfoo --path=./testing --path-pattern='*.txt'
248+ $ go-replace -s foobar -r barfoo --path=./testing --path-pattern='*.txt'
249249 $ cat testing/sub1/subsub/test1.txt
250250 this is a testline
251251 this is the second line
@@ -293,7 +293,7 @@ Testing with --output:
293293 > this is the third foobar line
294294 > this is the last line
295295 > EOF
296- $ goreplace -s foobar -r ___xxx test.txt --output test.output
296+ $ go-replace -s foobar -r ___xxx test.txt --output test.output
297297 $ cat test.output
298298 this is a testline
299299 this is the second line
@@ -309,7 +309,7 @@ Testing with --output but multiple arguments:
309309 > this is the last line
310310 > EOF
311311 $ cp test.txt test2.txt
312- $ goreplace -s foobar -r ___xxx test.txt test2.txt --output test.output
312+ $ go-replace -s foobar -r ___xxx test.txt test2.txt --output test.output
313313 Error: Only one file is allowed when using --output
314314 Command: .* (re)
315315 [1]
@@ -322,7 +322,7 @@ Testing with source:dest:
322322 > this is the third foobar line
323323 > this is the last line
324324 > EOF
325- $ goreplace -s foobar -r ___xxx test.txt:test.output
325+ $ go-replace -s foobar -r ___xxx test.txt:test.output
326326 $ cat test.output
327327 this is a testline
328328 this is the second line
0 commit comments