Merge pull request #2078 from h3poteto/iss-2024

refs #2024 Add help command for cli interface
This commit is contained in:
AkiraFukushima 2021-01-25 23:01:24 +09:00 committed by GitHub
commit 84d42698fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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')