Skip to content

Commit

Permalink
lotsofeedback
Browse files Browse the repository at this point in the history
  • Loading branch information
brendankenny committed Sep 26, 2018
1 parent aab4134 commit 1c45b83
Show file tree
Hide file tree
Showing 9 changed files with 1,360 additions and 38 deletions.
4 changes: 2 additions & 2 deletions lighthouse-cli/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ if (cliFlags.extraHeaders) {
*/
async function run() {
if (cliFlags.printConfig) {
const config = generateConfig(cliFlags, configJson);
process.stdout.write(config.print());
const config = generateConfig(configJson, cliFlags);
process.stdout.write(config.getPrintString());
return;
}

Expand Down
11 changes: 5 additions & 6 deletions lighthouse-cli/cli-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function getFlags(manualArgv) {
'only-audits': 'Only run the specified audits',
'only-categories': 'Only run the specified categories',
'skip-audits': 'Run everything except these audits',
'print-config': 'Print the full config that the current options will run with and exit.',
'print-config': 'Print the full, normalized config for the given config and options, then exit.',

This comment has been minimized.

Copy link
@paulirish

paulirish Sep 26, 2018

Member

s/full, //

})
// set aliases
.alias({'gather-mode': 'G', 'audit-mode': 'A'})
Expand Down Expand Up @@ -140,14 +140,13 @@ function getFlags(manualArgv) {
.default('enable-error-reporting', undefined) // Undefined so prompted by default
.check(/** @param {LH.CliFlags} argv */ (argv) => {
// Lighthouse doesn't need a URL if...
// - We're in auditMode (and we have artifacts already)
// - We're just listing the available options.
// - We're just printing the config.
// If one of these don't apply, stop the program and ask for a url.
const isListMode = argv.listAllAudits || argv.listTraceCategories;
// - We're in auditMode (and we have artifacts already)
// If one of these don't apply, if no URL, stop the program and ask for one.
const isPrintSomethingMode = argv.listAllAudits || argv.listTraceCategories || argv.printConfig;
const isOnlyAuditMode = !!argv.auditMode && !argv.gatherMode;
const isPrintConfigMode = argv.printConfig;
if (isListMode || isOnlyAuditMode || isPrintConfigMode) {
if (isPrintSomethingMode || isOnlyAuditMode) {
return true;
} else if (argv._.length > 0) {
return true;
Expand Down
Loading

0 comments on commit 1c45b83

Please sign in to comment.