added CLI option to paste text into terminal

This commit is contained in:
Eugene Pankov
2018-09-23 16:33:57 +02:00
parent 0545471f3c
commit e71d404c2b
12 changed files with 73 additions and 32 deletions

View File

@@ -1,3 +1,4 @@
import * as fs from 'fs'
import { app } from 'electron'
export function parseArgs (argv, cwd) {
@@ -13,11 +14,27 @@ export function parseArgs (argv, 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')
.command('paste [text]', 'paste stdin into the active tab', yargs => {
return yargs.option('escape', {
alias: 'e',
type: 'boolean',
describe: 'Perform shell escaping'
}).positional('text', {
type: 'string'
})
})
.version('version', '', app.getVersion())
.option('debug', {
alias: 'd',
describe: 'Show DevTools on start',
type: 'boolean'
})
.option('version', {
alias: 'v',
describe: 'Show version and exit',
type: 'boolean'
})
.help('help')
.strict()
.parse(argv.slice(1))
}