make usage warning more helpful

This commit is contained in:
Josh Deprez 2021-08-28 18:24:26 +10:00
parent c4948952b2
commit 906d5956a0

View file

@ -106,6 +106,10 @@ func (g *Game) cmdTree(dst io.Writer, argv []string) {
func (g *Game) cmdQuery(dst io.Writer, argv []string) {
if len(argv) < 2 || len(argv) > 3 {
fmt.Fprintln(dst, "Usage: query BEHAVIOUR [ANCESTOR_ID]")
fmt.Fprint(dst, "Behaviours:")
for _, b := range Behaviours {
fmt.Fprintf(dst, " %s", b.Name())
}
return
}