From 84c3c3f640193d72fd4d2ca4eda3ca5dd94ce9d5 Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Sat, 2 Sep 2017 14:30:44 -0700 Subject: [PATCH 1/6] Clarify some CLI option usage * `--ignore` can be specified multiple times * Explicitly mention `RegExp` for `--ignore` * Document `--no-package-manager` [ci skip] --- usage.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usage.txt b/usage.txt index bc191151..c7b997cd 100644 --- a/usage.txt +++ b/usage.txt @@ -44,15 +44,16 @@ electron-version the version of Electron that is being packaged, see extra-resource a file to copy into the app's resources directory icon the local path to an icon file to use as the icon for the app. Note: Format depends on platform. -ignore do not copy files into app whose filenames regex .match this string. See also: +ignore do not copy files into app whose filenames RegExp.match this string. See also: https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#ignore - and --no-prune. + and --no-prune. Can be specified multiple times no-prune do not prune devDependencies from the packaged app out the dir to put the app into at the end. defaults to current working dir overwrite if output directory for a platform already exists, replaces it rather than skipping it package-manager the package manager to use when pruning devDependencies. Supported package - managers: npm (default), cnpm, yarn + managers: npm (default), cnpm, yarn. Specify --no-package-manager to prune + without using a package manager platform all, or one or more of: darwin, linux, mas, win32 (comma-delimited if multiple). Defaults to the host platform quiet Do not print informational or warning messages From dbe271bbf99547a924dc7f26bdacb4aae1f07c0a Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Sat, 2 Sep 2017 14:34:47 -0700 Subject: [PATCH 2/6] Make assertion clearer --- test/cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cli.js b/test/cli.js index 25a7e37b..6ce97d34 100644 --- a/test/cli.js +++ b/test/cli.js @@ -69,7 +69,7 @@ test('CLI argument test: --protocol with a corresponding --protocol-name', (t) = test('CLI argument test: --protocol without a corresponding --protocol-name', (t) => { var args = common.parseCLIArgs(['--protocol=foo']) - t.deepEqual(args.protocols, undefined) + t.deepEqual(args.protocols, undefined, 'no protocols have been fully defined') t.end() }) From abe075fe830ab30c74294c16fb00be6a083a7b10 Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Sat, 2 Sep 2017 14:37:46 -0700 Subject: [PATCH 3/6] Document --no-deref-symlinks instead of --deref-symlinks --- usage.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usage.txt b/usage.txt index c7b997cd..6ded2274 100644 --- a/usage.txt +++ b/usage.txt @@ -31,7 +31,6 @@ asar whether to package the source code within your app into an ar - unpackDir: unpacks the dir to the app.asar.unpacked directory whose names glob pattern or exactly match this string. It's relative to the . build-version build version to set for the app -deref-symlinks whether symlinks should be dereferenced within the app source. Defaults to true. download a list of sub-options to pass to electron-download. They are specified via dot notation, e.g., --download.cache=/tmp/cache Properties supported: @@ -47,6 +46,7 @@ icon the local path to an icon file to use as the icon for the app ignore do not copy files into app whose filenames RegExp.match this string. See also: https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#ignore and --no-prune. Can be specified multiple times +no-deref-symlinks make sure symlinks are not dereferenced within the app source no-prune do not prune devDependencies from the packaged app out the dir to put the app into at the end. defaults to current working dir overwrite if output directory for a platform already exists, replaces it rather than From 4d14c1635b2c6437b6a9f9c838290bd182132bcc Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Sat, 2 Sep 2017 14:39:26 -0700 Subject: [PATCH 4/6] Add warnings for nonstandard argument usage --- NEWS.md | 4 ++++ common.js | 3 +++ 2 files changed, 7 insertions(+) diff --git a/NEWS.md b/NEWS.md index 67dfa2c3..c312dd25 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,10 @@ ## Unreleased +### Changed + +* CLI arguments with nonstandard argument values emit warnings (#722) + ## [9.0.1] - 2017-09-02 ### Fixed diff --git a/common.js b/common.js index 2d338d4b..0c5b10ef 100644 --- a/common.js +++ b/common.js @@ -51,6 +51,7 @@ function parseCLIArgs (argv) { } if (args.out === '') { + warning('Specifying --out= without a value is the same as the default value') args.out = null } @@ -58,11 +59,13 @@ function parseCLIArgs (argv) { // asar: `Object` or `true` if (args.asar === 'true' || args.asar instanceof Array) { + warning('--asar does not take any arguments, it only has sub-properties (see --help)') args.asar = true } // osx-sign: `Object` or `true` if (args.osxSign === 'true') { + warning('--osx-sign does not take any arguments, it only has sub-properties (see --help)') args.osxSign = true } From 7f6bdbb853263de1288b706e66367130c636cea3 Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Sat, 2 Sep 2017 14:40:14 -0700 Subject: [PATCH 5/6] Standardize on --no- instead of =false --- usage.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usage.txt b/usage.txt index 6ded2274..9dee4c29 100644 --- a/usage.txt +++ b/usage.txt @@ -37,7 +37,7 @@ download a list of sub-options to pass to electron-download. They are - cache: directory of cached Electron downloads. Defaults to `$HOME/.electron` - mirror: alternate URL to download Electron zips - strictSSL: whether SSL certs are required to be valid when downloading - Electron. Defaults to true, use --download.strictSSL=false to disable checks. + Electron. Defaults to true, use --no-download.strictSSL to disable checks. electron-version the version of Electron that is being packaged, see https://github.com/electron/electron/releases extra-resource a file to copy into the app's resources directory From c96023a87631c11761f2f102afca750b72e64733 Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Sat, 2 Sep 2017 14:40:51 -0700 Subject: [PATCH 6/6] Deprecate --tmpdir=false in favor of --no-tmpdir --- NEWS.md | 4 ++++ common.js | 1 + usage.txt | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index c312dd25..b74dc428 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,6 +6,10 @@ * CLI arguments with nonstandard argument values emit warnings (#722) +### Deprecated + +* In the CLI, `--tmpdir=false` has been deprecated in favor of `--no-tmpdir` (#722) + ## [9.0.1] - 2017-09-02 ### Fixed diff --git a/common.js b/common.js index 0c5b10ef..8f4ea9aa 100644 --- a/common.js +++ b/common.js @@ -71,6 +71,7 @@ function parseCLIArgs (argv) { // tmpdir: `String` or `false` if (args.tmpdir === 'false') { + warning('--tmpdir=false is deprecated, use --no-tmpdir instead') args.tmpdir = false } diff --git a/usage.txt b/usage.txt index 9dee4c29..00895b9c 100644 --- a/usage.txt +++ b/usage.txt @@ -57,7 +57,7 @@ package-manager the package manager to use when pruning devDependencies. Supp platform all, or one or more of: darwin, linux, mas, win32 (comma-delimited if multiple). Defaults to the host platform quiet Do not print informational or warning messages -tmpdir temp directory. Defaults to system temp directory, use --tmpdir=false to disable +tmpdir temp directory. Defaults to system temp directory, use --no-tmpdir to disable use of a temporary directory. * darwin/mas target platforms only *