Merge branch 'master' of github.com:Eugeny/tabby

This commit is contained in:
Eugene
2026-02-01 22:41:56 +01:00
2 changed files with 7 additions and 5 deletions
+1 -2
View File
@@ -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',
+6 -3
View File
@@ -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)