refs #2024 Add help command for cli interface

This commit is contained in:
AkiraFukushima 2021-01-24 19:01:34 +09:00
parent 1bba0b8985
commit 27b6ea8e52
2 changed files with 17 additions and 0 deletions

View File

@ -182,6 +182,7 @@
"i18next": "^19.8.4",
"lodash": "^4.17.20",
"megalodon": "3.3.2",
"minimist": "^1.2.5",
"moment": "^2.29.1",
"mousetrap": "^1.6.5",
"nedb": "^1.8.0",

View File

@ -28,6 +28,7 @@ import openAboutWindow from 'about-window'
import { Entity, detector } from 'megalodon'
import sanitizeHtml from 'sanitize-html'
import AutoLaunch from 'auto-launch'
import minimist from 'minimist'
import pkg from '~/package.json'
import Authentication from './auth'
@ -365,6 +366,21 @@ async function createWindow() {
}
}
// Parse command line arguments and show help command.
const args = minimist(process.argv.slice(process.env.NODE_ENV === 'development' ? 2 : 1))
if (args.help) {
console.log(`
Whalebird is Mastodon, Pleroma and Misskey client for desktop.
Usage
$ whalebird
Options
--help show help
`)
process.exit(0)
}
// Do not lower the rendering priority of Chromium when background
app.commandLine.appendSwitch('disable-renderer-backgrounding')