|
@@ -0,0 +1,17 @@
|
|
|
+use str
|
|
|
+
|
|
|
+fn complete {|command @rest|
|
|
|
+ (external $command) __complete $@rest 2>/dev/null | each {|line|
|
|
|
+ if (str:has-prefix $line ":") {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+
|
|
|
+ var @result = (str:split &max=2 "\t" $line)
|
|
|
+ var name = $result[0]
|
|
|
+ var description = $name
|
|
|
+ if (> (count $result) 1) {
|
|
|
+ set description = $description' ('$result[1]')'
|
|
|
+ }
|
|
|
+ edit:complex-candidate $result[0] &display=$description &code-suffix=' '
|
|
|
+ }
|
|
|
+}
|