mirror of
https://github.com/Eugeny/tabby.git
synced 2025-08-19 15:51:53 +00:00
.github
.vscode
app
assets
lib
app.ts
cli.ts
config.ts
index.ts
lru.ts
pluginManager.ts
portable.ts
pty.ts
sentry.ts
stringDecoder.ts
utfSplitter.ts
window.ts
src
dev-app-update.yml
index.pug
package.json
tsconfig.json
tsconfig.main.json
webpack.config.js
webpack.main.config.js
yarn.lock
build
docs
extras
locale
patches
scripts
snap
tabby-community-color-schemes
tabby-core
tabby-electron
tabby-linkifier
tabby-local
tabby-plugin-manager
tabby-serial
tabby-settings
tabby-ssh
tabby-telnet
tabby-terminal
tabby-uac
tabby-web
tabby-web-demo
web
.all-contributorsrc
.eslintrc.yml
.gitignore
.mergify.yml
.pug-lintrc.js
CODE_OF_CONDUCT.md
HACKING.md
LICENSE
README.ko-KR.md
README.md
README.ru-RU.md
README.zh-CN.md
appveyor.yml
electron-builder.yml
firebase.json
package.json
tsconfig.json
typedoc.js
webpack.config.js
webpack.plugin.config.js
yarn.lock
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
import { app } from 'electron'
|
|
|
|
export function parseArgs (argv: string[], cwd: string): any {
|
|
if (argv[0].includes('node')) {
|
|
argv = argv.slice(1)
|
|
}
|
|
|
|
return require('yargs/yargs')(argv.slice(1))
|
|
.usage('tabby [command] [arguments]')
|
|
.command('open [directory]', 'open a shell in a directory', {
|
|
directory: { type: 'string', 'default': cwd },
|
|
})
|
|
.command(['run [command...]', '/k'], 'run a command in the terminal', {
|
|
command: { type: 'string' },
|
|
})
|
|
.command('profile [profileName]', 'open a tab with specified profile', {
|
|
profileName: { type: 'string' },
|
|
})
|
|
.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',
|
|
})
|
|
})
|
|
.command('recent [index]', 'open a tab with a recent profile', {
|
|
profileNumber: { type: 'number' },
|
|
})
|
|
.version(app.getVersion())
|
|
.option('debug', {
|
|
alias: 'd',
|
|
describe: 'Show DevTools on start',
|
|
type: 'boolean',
|
|
})
|
|
.option('hidden', {
|
|
describe: 'Start minimized',
|
|
type: 'boolean',
|
|
})
|
|
.help('help')
|
|
.parse()
|
|
}
|