1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-30 18:53:30 +00:00

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) commands += " " + underline(usage)
} }
// Is the last argument trailing? If so, append ellipsis.
if cmd.Variadic {
commands += "..."
}
// Write the description if there's any. // Write the description if there's any.
if cmd.Description != "" { if cmd.Description != "" {
commands += ": " + cmd.Description commands += ": " + cmd.Description

View file

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