exclude titles
This commit is contained in:
parent
3e121a30c3
commit
7fac092b10
|
@ -953,6 +953,9 @@ function batchPages () {
|
||||||
const pageList = command.titles
|
const pageList = command.titles
|
||||||
const queryPageLimit = 500
|
const queryPageLimit = 500
|
||||||
const queryMaxTitles = 50
|
const queryMaxTitles = 50
|
||||||
|
const exclude = command.exclude ?
|
||||||
|
new RegExp( command.exclude ) :
|
||||||
|
{ test: () => false }
|
||||||
|
|
||||||
return Promise.coroutine( function* () {
|
return Promise.coroutine( function* () {
|
||||||
const queryOpt = {
|
const queryOpt = {
|
||||||
|
@ -1010,7 +1013,7 @@ function batchPages () {
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
if ( ! command.pages ) {
|
if ( ! command.pages || exclude.test( pageInfo.title )) {
|
||||||
log( 'x' , pageInfo.title )
|
log( 'x' , pageInfo.title )
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
@ -1123,6 +1126,7 @@ function main () {
|
||||||
wiki-page-URL \t URL of a sample page at the wiki to be dumped.
|
wiki-page-URL \t URL of a sample page at the wiki to be dumped.
|
||||||
\t\t\t This page's styling will be used as a template for all pages in the dump.` )
|
\t\t\t This page's styling will be used as a template for all pages in the dump.` )
|
||||||
.option( '-t, --titles [titles]', 'get only titles listed (separated by "|")' )
|
.option( '-t, --titles [titles]', 'get only titles listed (separated by "|")' )
|
||||||
|
.option( '-x, --exclude [title regexp]', 'exclude titles by a regular expression' )
|
||||||
.option( '-r, --rmdir', 'delete destination directory before processing the source' )
|
.option( '-r, --rmdir', 'delete destination directory before processing the source' )
|
||||||
.option( '--no-images', "don't download images" )
|
.option( '--no-images', "don't download images" )
|
||||||
.option( '--no-css', "don't page styling" )
|
.option( '--no-css', "don't page styling" )
|
||||||
|
|
Loading…
Reference in New Issue
Block a user