1 | diff --git a/bin/replace.js b/bin/replace.js
|
2 | index 318c573..0941bb4 100755
|
3 |
|
4 |
|
5 | @@ -34,12 +34,6 @@ var options = nomnom.opts({
|
6 | full: 'ignore-case',
|
7 | help: "Ignore case when matching"
|
8 | },
|
9 | - multiline: {
|
10 | - abbr: 'm',
|
11 | - flag: true,
|
12 | - help: "Match line by line, default is true",
|
13 | - default: true
|
14 | - },
|
15 | funcFile: {
|
16 | abbr: 'f',
|
17 | full: 'function-file',
|
18 | diff --git a/bin/search.js b/bin/search.js
|
19 | index b36f1a0..597acb2 100755
|
20 |
|
21 |
|
22 | @@ -24,12 +24,6 @@ var options = nomnom.opts({
|
23 | string: '-i, --ignore-case',
|
24 | help: "Ignore case when searching"
|
25 | },
|
26 | - multiline: {
|
27 | - abbr: 'm',
|
28 | - flag: true,
|
29 | - help: "Match line by line, default is true",
|
30 | - default: true
|
31 | - },
|
32 | include: {
|
33 | string: '--include=PATHS',
|
34 | help: "Only search in these files, e.g. '*.js,*.foo'"
|
35 | diff --git a/replace.js b/replace.js
|
36 | index 6e45164..587e909 100644
|
37 |
|
38 |
|
39 | @@ -13,13 +13,10 @@ var excludes = [],
|
40 |
|
41 | module.exports = function(opts) {
|
42 | options = opts;
|
43 | - var flags = "g"; // global multiline
|
44 | + var flags = "gm"; // global multiline
|
45 | if (options.ignoreCase) {
|
46 | flags += "i";
|
47 | }
|
48 | - if (options.multiline) {
|
49 | - flags += "m";
|
50 | - }
|
51 | regex = new RegExp(options.regex, flags);
|
52 | canReplace = !options.preview && options.replacement !== undefined;
|
53 |
|
54 | @@ -153,9 +150,7 @@ function replacizeText(text, file) {
|
55 | }
|
56 | console.log(printout);
|
57 | }
|
58 | - if (!options.silent && !options.quiet
|
59 | - && !(lineCount > options.maxLines)
|
60 | - && options.multiline) {
|
61 | + if (!options.silent && !options.quiet && !(lineCount > options.maxLines)) {
|
62 | var lines = text.split("\n");
|
63 | for (var i = 0; i < lines.length; i++) {
|
64 | var line = lines[i];
|