summaryrefslogtreecommitdiff
path: root/src/rhctl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rhctl')
-rw-r--r--src/rhctl/audio_switch_command.go30
-rw-r--r--src/rhctl/telnet.go7
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