Skip to content

Commit

Permalink
fix: sort commands/topics
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Feb 17, 2018
1 parent 908f8dd commit 165a53c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@oclif/config": "^1.3.56",
"@oclif/dev-cli": "^1.2.16",
"@oclif/errors": "^1.0.2",
"@oclif/plugin-legacy": "^1.0.2",
"@oclif/plugin-legacy": "^1.0.4",
"@oclif/plugin-plugins": "^1.0.1",
"@oclif/test": "^1.0.1",
"@oclif/tslint": "^1.0.2",
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ export default class Help {

commands(commands: (Config.Command | Config.Topic)[]): string | undefined {
if (!commands.length) return
commands = uniqBy(commands, c => id(c))
commands = uniqBy(commands, id)
commands = sortBy(commands, id)
let body = renderList(commands.map(c => [
id(c),
c.description && this.render(c.description.split('\n')[0])
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
call-me-maybe "^1.0.1"
glob-to-regexp "^0.3.0"

"@oclif/command@^1.3.0", "@oclif/command@^1.3.1":
"@oclif/command@^1.3.1":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.3.1.tgz#b2e063034f2fd39d89729bb2fe8f9cb070c4b4e1"
dependencies:
Expand Down Expand Up @@ -84,13 +84,13 @@
widest-line "^2.0.0"
wrap-ansi "^3.0.1"

"@oclif/plugin-legacy@^1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@oclif/plugin-legacy/-/plugin-legacy-1.0.2.tgz#b595edef2fd3411db9f3cc98205e72309116eed1"
"@oclif/plugin-legacy@^1.0.4":
version "1.0.4"
resolved "https://registry.yarnpkg.com/@oclif/plugin-legacy/-/plugin-legacy-1.0.4.tgz#dcd4845e230c39ae98ca07982ac848e8a54a7f5c"
dependencies:
"@heroku-cli/color" "^1.1.3"
"@heroku-cli/command" "^8.0.0-oclif.2"
"@oclif/command" "^1.3.0"
"@oclif/command" "^1.3.1"
ansi-escapes "^3.0.0"
debug "^3.1.0"
semver "^5.5.0"
Expand Down

0 comments on commit 165a53c

Please sign in to comment.