mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Improve grepper documentation.
This commit is contained in:
parent
b767e03449
commit
ebcfc2c7a1
Notes:
Gabriel Wicke
2012-02-28 14:24:37 +00:00
|
@ -1,3 +1,9 @@
|
|||
/**
|
||||
* A simple dump grepper based on the DumpReader module.
|
||||
*
|
||||
* @author Gabriel Wicke <gwicke@wikimedia.org>
|
||||
*/
|
||||
|
||||
var dumpReader = require('./dumpReader.js'),
|
||||
events = require('events'),
|
||||
optimist = require('optimist'),
|
||||
|
@ -22,18 +28,23 @@ DumpGrepper.prototype.grepRev = function ( revision ) {
|
|||
module.exports.DumpGrepper = DumpGrepper;
|
||||
|
||||
if (module === require.main) {
|
||||
var argv = optimist.usage( 'Usage: $0 <regexp>', {
|
||||
var argv = optimist.usage( 'Usage: zcat dump.xml.gz | $0 <regexp>', {
|
||||
'i': {
|
||||
description: 'Case-insensitive matching',
|
||||
'boolean': true,
|
||||
'default': false
|
||||
},
|
||||
'color': {
|
||||
description: 'Highlight matched substring using color',
|
||||
description: 'Highlight matched substring using color. Use --no-color to disable.',
|
||||
'boolean': true,
|
||||
'default': true
|
||||
}
|
||||
} ).argv;
|
||||
|
||||
if( argv.help ) {
|
||||
optimist.showHelp();
|
||||
process.exit( 0 );
|
||||
}
|
||||
|
||||
var flags = '';
|
||||
if(argv.i) {
|
||||
|
|
Loading…
Reference in a new issue