diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-04-03 22:29:09 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-04-03 22:29:09 (GMT) |
commit | 6dc55a27e931b7d2c1ab2a82a75e96c87153224b (patch) | |
tree | a8a8a12a65d48e56334e8df4043082d372568b0c | |
parent | 3e01ed80d3fe93ff8991958b5e7c622855a2dce1 (diff) |
telnet: print switch help
-rw-r--r-- | src/rhctl/audio_switch_command.go | 30 | ||||
-rw-r--r-- | src/rhctl/telnet.go | 7 |
2 files changed, 35 insertions, 2 deletions
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 <state-type>", + " 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 <num> <cmd> [ <input> ]", + " change audio input/output routings.", + " <num> specifies the audio output: one of 1, 2, all ", + " Commands:", + " - apply <input> simulate select button press", + " - add <input> add <input> to output routing", + " - remove <input> remove <input> from output routing", + " - up <input> fade up <input> (only allowed for output 1)", + " - down <input> fade down <input> (only allowed for output 1)", + " - mute [ <input> ] mute <input> or whole <output>", + "", + "relay <num> (latch|unlatch|pulse)", + " Control open-collector outputs.", + "", + "oc <num> (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 <cmd> [ [ <arg1> ] ... ]") - 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 |