Bot: Variadic arguments are now ellipsized in help

This commit is contained in:
diamondburned (Forefront) 2020-05-03 18:35:51 -07:00
parent b122aa6561
commit cf48bd8543
2 changed files with 8 additions and 1 deletions

View File

@ -265,6 +265,11 @@ func (sub *Subcommand) Help(indent string, hideAdmin bool) string {
commands += " " + underline(usage)
}
// Is the last argument trailing? If so, append ellipsis.
if cmd.Variadic {
commands += "..."
}
// Write the description if there's any.
if cmd.Description != "" {
commands += ": " + cmd.Description

View File

@ -1,6 +1,8 @@
package bot
import "testing"
import (
"testing"
)
func TestNewSubcommand(t *testing.T) {
_, err := NewSubcommand(&testc{})