Skip to content

Commit

Permalink
Merge pull request #722 from electron-userland/clean-up-cli
Browse files Browse the repository at this point in the history
Clean up CLI options/docs
  • Loading branch information
malept committed Sep 10, 2017
2 parents 653c146 + c96023a commit 27f4f73
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
8 changes: 8 additions & 0 deletions NEWS.md
Expand Up @@ -2,6 +2,14 @@

## Unreleased

### Changed

* 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
Expand Down
4 changes: 4 additions & 0 deletions common.js
Expand Up @@ -51,23 +51,27 @@ function parseCLIArgs (argv) {
}

if (args.out === '') {
warning('Specifying --out= without a value is the same as the default value')
args.out = null
}

// Overrides for multi-typed arguments, because minimist doesn't support it

// 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
}

// tmpdir: `String` or `false`
if (args.tmpdir === 'false') {
warning('--tmpdir=false is deprecated, use --no-tmpdir instead')
args.tmpdir = false
}

Expand Down
2 changes: 1 addition & 1 deletion test/cli.js
Expand Up @@ -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()
})

Expand Down
13 changes: 7 additions & 6 deletions usage.txt
Expand Up @@ -31,32 +31,33 @@ 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 <sourcedir>.
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:
- 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
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-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
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
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 *
Expand Down

0 comments on commit 27f4f73

Please sign in to comment.