From 67615719ae3cdc12a8fb38c286145da2912ebe3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Mon, 27 Apr 2015 18:43:26 +0200 Subject: [PATCH] Add device selection option to CLI --- bin/cli.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/cli.js b/bin/cli.js index 832112f..b22da78 100644 --- a/bin/cli.js +++ b/bin/cli.js @@ -12,6 +12,7 @@ var cli = meow({ ' yellowlabtools ', '', 'Options:', + ' --device Use "phone" or "tablet" to simulate a mobile device (by user-agent and viewport size).', ' --screenshot Will take a screenshot and use this value as the output path. It needs to end with ".png".', ' --js-deep-analysis When activated, the javascriptExecutionTree will contain sub-requests.', '' @@ -50,6 +51,9 @@ if (cli.flags.jsDeepAnalysis === true || cli.flags.jsDeepAnalysis === 'true') { options.jsDeepAnalysis = true; } +// Device simulation +options.device = cli.flags.device || 'desktop'; + (function execute(url, options) { 'use strict';