mirror of
https://github.com/eugeny/tabby
synced 2026-08-26 07:46:34 +00:00
Merge branch 'master' of github.com:Eugeny/tabby
This commit is contained in:
+1
-2
@@ -30,9 +30,8 @@ export function parseArgs (argv: string[], cwd: string): any {
|
||||
})
|
||||
.command('quickConnect <providerId> <query>', 'open a tab for specified quick connect provider', yargs => {
|
||||
return yargs.positional('providerId', {
|
||||
describe: 'The name of a quick connect profile provider',
|
||||
describe: 'The name of a quick connect profile provider (e.g., ssh, telnet)',
|
||||
type: 'string',
|
||||
choices: ['ssh', 'telnet'],
|
||||
}).positional('query', {
|
||||
describe: 'The quick connect query string',
|
||||
type: 'string',
|
||||
|
||||
@@ -55,9 +55,12 @@ export class ProfileCLIHandler extends CLIHandler {
|
||||
}
|
||||
|
||||
private async handleOpenQuickConnect (providerId: string, query: string) {
|
||||
const provider = this.profiles.getProviders().find(x => x.id === providerId)
|
||||
if(!provider || !(provider instanceof QuickConnectProfileProvider)) {
|
||||
console.error(`Requested provider "${providerId}" not found`)
|
||||
const quickConnectProviders = this.profiles.getProviders()
|
||||
.filter((x): x is QuickConnectProfileProvider<any> => x instanceof QuickConnectProfileProvider)
|
||||
const provider = quickConnectProviders.find(x => x.id === providerId)
|
||||
if(!provider) {
|
||||
const available = quickConnectProviders.map(x => x.id).join(', ')
|
||||
console.error(`Requested provider "${providerId}" not found. Available providers: ${available}`)
|
||||
return
|
||||
}
|
||||
const profile = provider.quickConnect(query)
|
||||
|
||||
Reference in New Issue
Block a user