From 6dc55a27e931b7d2c1ab2a82a75e96c87153224b Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 4 Apr 2016 00:29:09 +0200 Subject: telnet: print switch help diff --git a/src/rhctl/audio_switch_command.go b/src/rhctl/audio_switch_command.go index b71cfbd..7c9e4b6 100644 --- a/src/rhctl/audio_switch_command.go +++ b/src/rhctl/audio_switch_command.go @@ -398,6 +398,36 @@ func SwitchCommandParseOC(args []string) (cmdstr SwitchCmdString, cmdargs []inte return } +func SwitchCommandHelp() []string { + return []string{ + "state ", + " request status update. The following types are allowed:", + " - audio audio input/ouput routings", + " - gpi state of general purpose inputs", + " - oc state of open-collector outputs", + " - relay state of relay outputs", + " - silence output silence monitor state", + "", + "out [ ]", + " change audio input/output routings.", + " specifies the audio output: one of 1, 2, all ", + " Commands:", + " - apply simulate select button press", + " - add add to output routing", + " - remove remove from output routing", + " - up fade up (only allowed for output 1)", + " - down fade down (only allowed for output 1)", + " - mute [ ] mute or whole ", + "", + "relay (latch|unlatch|pulse)", + " Control open-collector outputs.", + "", + "oc (latch|unlatch|pulse)", + " Control relay outputs.", + "", + } +} + func NewSwitchCommandFromStrings(cmd string, args ...string) (c *SwitchCommand, err error) { c = &SwitchCommand{} switch strings.ToLower(cmd) { diff --git a/src/rhctl/telnet.go b/src/rhctl/telnet.go index 98dce0d..43e571e 100644 --- a/src/rhctl/telnet.go +++ b/src/rhctl/telnet.go @@ -252,8 +252,11 @@ func telnetHelp(c *telgo.Client, args []string) bool { return false case "switch": c.Sayln("usage: switch [ [ ] ... ]") - c.Sayln(" send commands to tha audio switch directly.") - // TODO: print help text for raw switch commands + c.Sayln(" send commands to tha audio switch directly. Possible commands:") + help := SwitchCommandHelp() + for _, line := range help { + c.Sayln(" %s", line) + } return false } fallthrough -- cgit v0.10.2