Skip to content

Commit

Permalink
fix(autocomplete): filepath completions (#968)
Browse files Browse the repository at this point in the history
  • Loading branch information
RasPhilCo committed Aug 2, 2018
1 parent c629c84 commit b681eb5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/autocomplete/src/commands/autocomplete/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,8 @@ export default class Create extends AutocompleteBase {
const hasCompletion = f.hasOwnProperty('completion') || this.findCompletion(flag, id)
const name = isBoolean ? flag : `${flag}=-`
let cachecompl = ''
if (hasCompletion) {
cachecompl = this.wantsLocalFiles(flag) ? ':_files' : ': :_compadd_flag_options'
}
if (hasCompletion) { cachecompl = ': :_compadd_flag_options' }
if (this.wantsLocalFiles(flag)) { cachecompl = ': :_files' }
const help = isBoolean ? '(switch) ' : (hasCompletion ? '(autocomplete) ' : '')
const completion = `--${name}[${help}${f.description}]${cachecompl}`
return `"${completion}"`
Expand Down

0 comments on commit b681eb5

Please sign in to comment.