Skip to content

Commit

Permalink
feat: Updates the commander describing
Browse files Browse the repository at this point in the history
  • Loading branch information
devedbox committed Oct 13, 2018
1 parent 793f490 commit 76fd51e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Commander/Commands/CommandDescriber.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ internal struct CommandDescriber {
self.intents = intents
}

internal func describe(_ commander: Commander.Type) -> String {
let commandsSymbols = commander.allCommands.map { ($0.symbol, $0.usage) }
internal func describe(commander usage: String, commands: [AnyCommandRepresentable.Type]) -> String {
let commandsSymbols = commands.map { ($0.symbol, $0.usage) }

let count = commandsSymbols.reduce(0) { max($0, $1.0.count) }
let alignment = String(repeating: " ", count: count)
Expand All @@ -61,7 +61,7 @@ internal struct CommandDescriber {
\(returns(0))
\(intents(1))$ \(path) COMMAND
\(returns(0))
\(intents(2))\(Commander.usage)
\(intents(2))\(usage)
\(returns(0))
Commands:
\(returns(0))
Expand Down

0 comments on commit 76fd51e

Please sign in to comment.