experimental support for multiple windows (fixes #212, fixes #170)

This commit is contained in:
Eugene Pankov
2018-08-31 15:41:28 +02:00
parent 0749096d9f
commit 4b7b692ace
25 changed files with 577 additions and 395 deletions

23
app/lib/cli.ts Normal file
View File

@@ -0,0 +1,23 @@
import { app } from 'electron'
export function parseArgs (argv, cwd) {
if (argv[0].includes('node')) {
argv = argv.slice(1)
}
return require('yargs')
.usage('terminus [command] [arguments]')
.command('open [directory]', 'open a shell in a directory', {
directory: { type: 'string', 'default': cwd },
})
.command('run [command...]', 'run a command in the terminal', {
command: { type: 'string' },
})
.version('v', 'Show version and exit', app.getVersion())
.alias('d', 'debug')
.describe('d', 'Show DevTools on start')
.alias('h', 'help')
.help('h')
.strict()
.parse(argv.slice(1))
}