Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Side by Side Diff: third_party/sqlite/sqlite-src-3170000/tool/replace.tcl

Issue 2747283002: [sql] Import reference version of SQLite 3.17.. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/tcl
2 #
3 # Replace string with another string -OR- include
4 # only lines successfully modified with a regular
5 # expression.
6 #
7 fconfigure stdout -translation binary -encoding binary
8 fconfigure stderr -translation binary -encoding binary
9 set mode [string tolower [lindex $argv 0]]
10 set from [lindex $argv 1]
11 set to [lindex $argv 2]
12 if {$mode ni [list exact regsub include]} {exit 1}
13 if {[string length $from]==0} {exit 2}
14 while {![eof stdin]} {
15 set line [gets stdin]
16 if {[eof stdin]} break
17 switch -exact $mode {
18 exact {set line [string map [list $from $to] $line]}
19 regsub {regsub -all -- $from $line $to line}
20 include {if {[regsub -all -- $from $line $to line]==0} continue}
21 }
22 puts stdout $line
23 }
OLDNEW
« no previous file with comments | « third_party/sqlite/sqlite-src-3170000/tool/pagesig.c ('k') | third_party/sqlite/sqlite-src-3170000/tool/restore_jrnl.tcl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698