mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-19 18:07:58 +00:00
23
app/lib/cli.ts
Normal file
23
app/lib/cli.ts
Normal 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))
|
||||
}
|
Reference in New Issue
Block a user