Skip to content

Commit

Permalink
fix: block pwsh completion if CLI uses colon sep
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 committed Aug 1, 2023
1 parent f7b2524 commit a15b628
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/commands/autocomplete/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Args, ux, Flags} from '@oclif/core'
import {EOL} from 'os'
import * as chalk from 'chalk'

import {AutocompleteBase} from '../../base'
Expand Down Expand Up @@ -32,6 +33,10 @@ export default class Index extends AutocompleteBase {
const {args, flags} = await this.parse(Index)
const shell = args.shell || this.determineShell(this.config.shell)

if (shell === 'powershell' && this.config?.topicSeparator === ':') {
this.error(`PowerShell completion is not supported in CLIs using colon as the topic separator.${EOL}See: https://oclif.io/docs/topic_separator`)
}

ux.action.start(`${chalk.bold('Building the autocomplete cache')}`)
await Create.run([], this.config)
ux.action.stop()
Expand Down

0 comments on commit a15b628

Please sign in to comment.