Issues.00288 - lordmundi/wikidoctest GitHub Wiki
00288: dynamic listing of tcl command usage
Summary: dynamic listing of tcl command usage
Created: 2010–11–03 07:16
Status: Submitted
Category: Request
From: frankie
Version: 2.1
Released_In:
Description:
our documentation currently lists doug tcl commands as subcommands for things like doug.cmd, doug.node, doug.plugin, etc.
As these get updated, and the arguments to those functions get updated, the documentation gets out of sync. Also, there is no way at runtime to know what commands/subcommands are available and what the arguments to them should be, even though all of this has to be coded inside of the plugin.
This is a request to have some way to request the usage of a particular command. For example doug.cmd -usage may print out all of the available subcommands, and then doug.cmd -usage plugin_info might print any usage information registered by that command.
If this is implemented in a generic way, plugins would be able to register usage text for all of their tcl commands in addition to the command itself and the version string. That way, if someone does: "doug.plugin speedtest -usage" it would automatically print the usage information in a nicely formatted way that the user has provided. This would give a way to know what commands are available (at any level) and what the arguments should be.
If tcl has some built in mechanisms like this for procedures, we should probably look at that and try to do things in a similar manner. I'm not sure if "-usage" is the best syntax. If tcl does have some built in method for this, we could be doing this for commands defined in tcl scripts as well as C code!