瀏覽代碼

moved code

Former-commit-id: 6fb3f2f1acb69a533404c01e5444585f8f1675a1
Gildas 5 年之前
父節點
當前提交
13121cd344
共有 2 個文件被更改,包括 7 次插入6 次删除
  1. 7 2
      cli/args.js
  2. 0 4
      cli/single-file

+ 7 - 2
cli/args.js

@@ -23,7 +23,7 @@
 
 /* global require, module */
 
-module.exports = require("yargs")
+const args = require("yargs")
 	.wrap(null)
 	.command("$0 [url] [output]", "Save a page into a single HTML file.", yargs => {
 		yargs.positional("url", { description: "URL or path on the filesystem of the page to save", type: "string" });
@@ -167,4 +167,9 @@ module.exports = require("yargs")
 	.boolean("user-script-enabled")
 	.options("web-driver-executable-path", { description: "Path to Selenium WebDriver executable (webdriver-gecko, webdriver-chromium)" })
 	.string("web-driver-executable-path")
-	.argv;
+	.argv;
+args.compressCSS = args.compressCss;
+args.compressHTML = args.compressHtml;
+args.includeBOM = args.includeBom;
+args.crawlReplaceURLs = args.crawlReplaceUrls;
+module.exports = args;

+ 0 - 4
cli/single-file

@@ -38,10 +38,6 @@ const backEnds = {
 	"webdriver-chromium": "./back-ends/webdriver-chromium.js",
 	"webdriver-gecko": "./back-ends/webdriver-gecko.js"
 };
-options.compressCSS = options.compressCss;
-options.compressHTML = options.compressHtml;
-options.includeBOM = options.includeBom;
-options.crawlReplaceURLs = options.crawlReplaceUrls;
 if (options.url && !VALID_URL_TEST.test(options.url)) {
 	options.url = fileUrl(options.url);
 }