Skip to content

Commit

Permalink
fix(aliases): add generic topic description
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 committed Feb 14, 2023
1 parent ca03e17 commit b00353f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/autocomplete/zsh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,21 +395,21 @@ _${this.config.bin}

const split = a.split(':')

let words = split[0]
let topic = split[0]

// Completion funcs are generated from topics:
// `force` -> `force:org` -> `force:org:open|list`
//
// but aliases aren't guaranteed to follow the plugin command tree
// so we need to add any missing topic between the starting point and the alias.
for (let i = 0; i < split.length - 1; i++) {
if (!this.topics.find(t => t.name === words)) {
if (!this.topics.find(t => t.name === topic)) {
this.topics.push({
name: words,
description: '',
name: topic,
description: `${topic.replace(/:/g, ' ')} commands`,
})
}
words += `:${split[i + 1]}`
topic += `:${split[i + 1]}`
}
})
})
Expand Down

0 comments on commit b00353f

Please sign in to comment.