Skip to content

Commit

Permalink
Merge pull request #10530 from vector-im/t3chguy/electron_help
Browse files Browse the repository at this point in the history
Add --help to electron app
  • Loading branch information
t3chguy committed Aug 9, 2019
2 parents feb6279 + 12f0874 commit 906045b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion electron_app/src/electron-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ limitations under the License.
const checkSquirrelHooks = require('./squirrelhooks');
if (checkSquirrelHooks()) return;

const argv = require('minimist')(process.argv);
const argv = require('minimist')(process.argv, {
alias: {help: "h"},
});

const {app, ipcMain, powerSaveBlocker, BrowserWindow, Menu, autoUpdater, protocol} = require('electron');
const AutoLaunch = require('auto-launch');
const path = require('path');
Expand All @@ -37,6 +40,19 @@ const { migrateFromOldOrigin } = require('./originMigrator');
const windowStateKeeper = require('electron-window-state');
const Store = require('electron-store');

if (argv["help"]) {
console.log("Options:");
console.log(" --profile-dir {path}: Path to where to store the profile.");
console.log(" --profile {name}: Name of alternate profile to use, allows for running multiple accounts.");
console.log(" --devtools: Install and use react-devtools and react-perf.");
console.log(" --no-update: Disable automatic updating.");
console.log(" --hidden: Start the application hidden in the system tray.");
console.log(" --help: Displays this help message.");
console.log("And more such as --proxy, see:" +
"https://github.com/electron/electron/blob/master/docs/api/chrome-command-line-switches.md");
app.exit();
}

// boolean flag set whilst we are doing one-time origin migration
// We only serve the origin migration script while we're actually
// migrating to mitigate any risk of it being used maliciously.
Expand Down

0 comments on commit 906045b

Please sign in to comment.