Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Show the files containing the matched word in color #22

Merged
merged 1 commit into from
Mar 31, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bin/shared-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ module.exports = {
choices: ['red', 'green', 'blue', 'cyan', 'yellow', 'magenta', 'bold', 'italic'],
default: 'cyan'
},
fileColor: {
help: "highlight matching file's name in color, e.g. 'green' or 'blue'",
choices: ['red', 'green', 'blue', 'cyan', 'yellow', 'magenta', 'bold', 'italic'],
default: 'yellow'
},
async: {
abbr: 'a',
flag: true,
Expand Down
2 changes: 1 addition & 1 deletion replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ module.exports = function(options) {
}

if (!options.silent) {
var printout = " " + file;
var printout = " " + file[options.fileColor];
if (options.count) {
printout += (" (" + match.length + ")").grey;
}
Expand Down