summaryrefslogtreecommitdiff
path: root/src/helsinki.at
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-12-18 20:08:16 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-12-18 20:08:16 (GMT)
commit6e5d2a18a5d1794433e72a8f1b7df899d2c4ffe0 (patch)
tree585a1201e69fd994ef80bab89cd2125233f1bea6 /src/helsinki.at
parentf2cb74e053c70e5edde771f5efdd75cbf5c4e4cb (diff)
telnet client help command
Diffstat (limited to 'src/helsinki.at')
-rw-r--r--src/helsinki.at/rhimportd/ctrlTelnet.go71
1 files changed, 68 insertions, 3 deletions
diff --git a/src/helsinki.at/rhimportd/ctrlTelnet.go b/src/helsinki.at/rhimportd/ctrlTelnet.go
index 93cd25b..dd95cd6 100644
--- a/src/helsinki.at/rhimportd/ctrlTelnet.go
+++ b/src/helsinki.at/rhimportd/ctrlTelnet.go
@@ -57,7 +57,74 @@ func (c *TelnetClient) say(format string, a ...interface{}) (err error) {
}
func (c *TelnetClient) handle_cmd_help(args []string) {
- c.say("usage: tba...(args: %v)", args)
+ switch len(args) {
+ case 1:
+ switch args[0] {
+ case "quit":
+ c.say("usage: quit")
+ c.say(" terminates the client connection.")
+ return
+ case "help":
+ c.say("usage: help [ <cmd> ]")
+ c.say(" prints command overview or detailed info to <cmd>.")
+ return
+ case "set":
+ c.say("usage: set <param> <value>")
+ c.say(" this sets the import parameter <param> to <value>.")
+ c.say("")
+ c.say(" available parameters:")
+ c.say(" UserName string username to use for requests to rivendell rdxport interface")
+ c.say(" Password string password to use for requests to rivendell rdxport interface")
+ c.say(" SourceUri string uri to the file to import")
+ c.say(" ShowId uint the RHRD show id to import to")
+ c.say(" ClearShowCarts bool tells the importer to clear all show-carts before importing to a show")
+ c.say(" GroupName string name of music-pool group to import to")
+ c.say(" Cart uint cart to import to")
+ c.say(" ClearCart bool remove all existing cuts from cart before importing?")
+ c.say(" Cut uint cut to import to")
+ c.say(" Channels uint number of audio channels (defaults to: %v)", c.conf.ImportParamDefaults.Channels)
+ c.say(" NormalizationLevel int normalization level in dB (defaults to: %v)", c.conf.ImportParamDefaults.NormalizationLevel)
+ c.say(" AutotrimLevel int autotrim level in dB (defaults to: %v)", c.conf.ImportParamDefaults.AutotrimLevel)
+ c.say(" UseMetaData bool extract meta data from source file (defaults to: %v)", c.conf.ImportParamDefaults.UseMetaData)
+ c.say("")
+ c.say(" If ShowId is supplied GroupName, Channels, NomalizationLevel, AutorimLevel, UseMetaData")
+ c.say(" and Cut will be ignored. The values from the shows dropbox will be used instead. Cart may")
+ c.say(" be specified but must point to a empty cart within that show. If Cart is 0 the next free")
+ c.say(" cart in the show will be used. Show carts will always be imported into cut 1.")
+ c.say("")
+ c.say(" If GroupName is supplied Channels, NomalizationLevel, AutorimLevel, UseMetaData, Cut and")
+ c.say(" Cart will be ignored. The values from the music pools dropbox will be used instead. The ")
+ c.say(" file will always be imported into cut 1 of the first free cart within the music pool.")
+ c.say("")
+ c.say(" If Cut is omitted the file will imported into the next free cut within the cart.")
+ c.say("")
+ c.say(" In case of an error carts/cuts which might got created will be removed. Carts which got")
+ c.say(" deleted because of ClearShowCarts or ClearCart are however gone for good.")
+ return
+ case "show":
+ c.say("usage: show")
+ c.say(" this prints the current values of all import parameters.")
+ return
+ case "reset":
+ c.say("usage: reset")
+ c.say(" this resets all import parameters to default values.")
+ return
+ case "run":
+ c.say("usage: run")
+ c.say(" this starts the fetch/import process according to the current import parameters.")
+ return
+ }
+ fallthrough
+ default:
+ c.say("usage: <cmd> [ [ <arg1> ] ... ]")
+ c.say(" available commands:")
+ c.say(" quit close connection")
+ c.say(" help [ <cmd> ] print this, or help for specific command")
+ c.say(" set <param> <value> sets parameter <param> on current import context")
+ c.say(" show shows current import context")
+ c.say(" reset resets current import context")
+ c.say(" run runs fetch/import using current import context")
+ }
}
func (c *TelnetClient) handle_cmd_set(args []string) {
@@ -84,7 +151,6 @@ func (c *TelnetClient) handle_cmd_show(args []string) {
if c.ctx != nil {
c.say(" UserName: %v", c.ctx.UserName)
c.say(" Password: %v", c.ctx.Password)
- c.say(" Trusted: %v", c.ctx.Trusted)
c.say(" ShowId: %v", c.ctx.ShowId)
c.say(" ClearShowCarts: %v", c.ctx.ClearShowCarts)
c.say(" GroupName: %v", c.ctx.GroupName)
@@ -104,7 +170,6 @@ func (c *TelnetClient) handle_cmd_show(args []string) {
func (c *TelnetClient) handle_cmd_run(args []string) {
if c.ctx != nil {
c.say("running args: %v", args)
- c.ctx = nil
} else {
c.say("context is empty please set at least one option")
}