Aliasing crawler depth to '-d' for easy of use. (#925)
This commit is contained in:
parent
906e538877
commit
d808112738
|
|
@ -35,7 +35,6 @@ if (log.isEnabledFor(log.CRITICAL)) { // TODO change the threshold to VERBOSE be
|
|||
|
||||
log.info('Versions OS: %s sitespeed.io: %s browsertime: %s coach: %s', os.platform() + ' ' + os.release(), packageInfo.version, packageInfo.dependencies.browsertime, packageInfo.dependencies.webcoach);
|
||||
|
||||
// FIXME need to consider aliases, e.g. -d => --crawler.depth
|
||||
loader.parsePluginNames(parsed.raw)
|
||||
.then((pluginNames) => {
|
||||
if (allInArray(['browsertime', 'coach'], pluginNames)) {
|
||||
|
|
|
|||
|
|
@ -74,7 +74,8 @@ module.exports.parseCommandLine = function parseCommandLine() {
|
|||
/*
|
||||
Crawler options
|
||||
*/
|
||||
.option('crawler.depth', {
|
||||
.option('d', {
|
||||
alias: 'crawler.depth',
|
||||
describe: 'How deep to crawl (1=only one page, 2=include links from first page, etc.)',
|
||||
group: 'Crawler'
|
||||
})
|
||||
|
|
@ -254,6 +255,11 @@ module.exports.parseCommandLine = function parseCommandLine() {
|
|||
}
|
||||
// End hack
|
||||
|
||||
// FIXME: Find a solution that would work for all aliasing
|
||||
if(argv.d) {
|
||||
rawArgv = merge({}, {"crawler": {"depth": argv.d}}, rawArgv);
|
||||
}
|
||||
|
||||
return {
|
||||
url: argv._[0],
|
||||
options: argv,
|
||||
|
|
|
|||
Loading…
Reference in New Issue