         let lines: [String] = options.map { (option) in
             let first = "(" + option.names.joined(separator: " ") + ")"
             let middle = "{" + option.names.joined(separator: ",") + "}"
-            let end = "[" + option.shortDescription + "]"
+            let end: String
+            if option.shortDescription.isEmpty {
+                let sortedNames = option.names.sorted(by: {$0.characters.count > $1.characters.count})
+                end = "[" + sortedNames.first!.trimmingCharacters(in: CharacterSet(charactersIn: "-")) + "]"
+            } else {
+                end = "[" + option.shortDescription + "]"
+            }
             return "      '\(first)'\(middle)'\(end)'"
         }
         stream << lines.joined(separator: " \\\n")

        self.cli = cli
    }
    
    public func writeCompletions(into stream: CompletionOutputStream = StdoutStream()) {
        stream << "#compdef \(cli.name)"
        
        writeEntryFunction(into: stream)

//
//  Created by Jake Heiser on 9/10/17.
//

import Foundation

public enum Shell {
    case bash
