diff options
Diffstat (limited to 'cmd/dolmetschctld/telnet.go')
-rw-r--r-- | cmd/dolmetschctld/telnet.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/dolmetschctld/telnet.go b/cmd/dolmetschctld/telnet.go index 901c226..d6a5c4a 100644 --- a/cmd/dolmetschctld/telnet.go +++ b/cmd/dolmetschctld/telnet.go @@ -74,6 +74,15 @@ func telnetCmdRatio(c *telgo.Client, args []string, sm *StateMachine) bool { return false } +func telnetCmdState(c *telgo.Client, args []string, sm *StateMachine) bool { + if len(args) != 1 { + c.Sayln("usage: state") + return false + } + c.Sayln("current state: %s", sm.GetState()) + return false +} + func telnetQuit(c *telgo.Client, args []string) bool { return true } @@ -88,6 +97,7 @@ func NewTelnetInterface(addr string, sm *StateMachine) (telnet *TelnetInterface, cmdlist := make(telgo.CmdList) cmdlist["lang"] = func(c *telgo.Client, args []string) bool { return telnetCmdLang(c, args, sm) } cmdlist["ratio"] = func(c *telgo.Client, args []string) bool { return telnetCmdRatio(c, args, sm) } + cmdlist["state"] = func(c *telgo.Client, args []string) bool { return telnetCmdState(c, args, sm) } cmdlist["quit"] = telnetQuit telnet.server, err = telgo.NewServer(addr, "dolmetschctl> ", cmdlist, nil) |