Skip to content

Commit

Permalink
Merge pull request #498 from oclif/cd/block-pwsh-colon-sep-cli
Browse files Browse the repository at this point in the history
fix: block pwsh completion if CLI uses colon sep
  • Loading branch information
mdonnalley authored Aug 2, 2023
2 parents f7b2524 + a15b628 commit 346fb1b
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 346fb1b

Please sign in to comment.