mirror of
https://github.com/Eugeny/tabby.git
synced 2024-12-09 06:20:22 +08:00
24 lines
725 B
TypeScript
24 lines
725 B
TypeScript
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))
|
|
}
|