diff options
author | Matthew Jordan <mjordan@digium.com> | 2013-02-15 13:38:12 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2013-02-15 13:38:12 +0000 |
commit | d04ab3c6450f3d92aa004ae9d6e0e7da51f702a3 (patch) | |
tree | 821330ff71a4484afa46ade4a2bbd211c800a992 /apps/app_skel.c | |
parent | edf0483f4f0e73ded128f1e613b60f31925af102 (diff) |
Add CLI configuration documentation
This patch allows a module to define its configuration in XML in source, such
that it can be parsed by the XML documentation engine. Documentation is
generated in a two-pass approach:
1. The documentation is first generated from the XML pulled from the source
2. The documentation is then enhanced by the registration of configuration
options that use the configuration framework
This patch include configuration documentation for the following modules:
* chan_motif
* res_xmpp
* app_confbridge
* app_skel
* udptl
Two new CLI commands have been added:
* config show help - show configuration help by module, category, and item
* xmldoc dump - dump the in-memory representation of the XML documentation to
a new XML file.
Review: https://reviewboard.asterisk.org/r/2278
Review: https://reviewboard.asterisk.org/r/2058
patches:
on review 2058 uploaded by twilson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_skel.c')
-rw-r--r-- | apps/app_skel.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/apps/app_skel.c b/apps/app_skel.c index 6fdbebbf2..8a5b5bc75 100644 --- a/apps/app_skel.c +++ b/apps/app_skel.c @@ -86,6 +86,51 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") from. It shows you the basic structure to create your own Asterisk applications.</para> </description> </application> + + <configInfo name="app_skel" language="en_US"> + <configFile name="app_skel.conf"> + <configObject name="globals"> + <synopsis>Options that apply globally to app_skel</synopsis> + <configOption name="games"> + <synopsis>The number of games a single execution of SkelGuessNumber will play</synopsis> + </configOption> + <configOption name="cheat"> + <synopsis>Should the computer cheat?</synopsis> + <description><para>If enabled, the computer will ignore winning guesses.</para></description> + </configOption> + </configObject> + <configObject name="sounds"> + <synopsis>Prompts for SkelGuessNumber to play</synopsis> + <configOption name="prompt" default="please-enter-your&number&queue-less-than"> + <synopsis>A prompt directing the user to enter a number less than the max number</synopsis> + </configOption> + <configOption name="wrong_guess" default="vm-pls-try-again"> + <synopsis>The sound file to play when a wrong guess is made</synopsis> + </configOption> + <configOption name="right_guess" default="auth-thankyou"> + <synopsis>The sound file to play when a correct guess is made</synopsis> + </configOption> + <configOption name="too_low"> + <synopsis>The sound file to play when a guess is too low</synopsis> + </configOption> + <configOption name="too_high"> + <synopsis>The sound file to play when a guess is too high</synopsis> + </configOption> + <configOption name="lose" default="vm-goodbye"> + <synopsis>The sound file to play when a player loses</synopsis> + </configOption> + </configObject> + <configObject name="level"> + <synopsis>Defined levels for the SkelGuessNumber game</synopsis> + <configOption name="max_number"> + <synopsis>The maximum in the range of numbers to guess (1 is the implied minimum)</synopsis> + </configOption> + <configOption name="max_guesses"> + <synopsis>The maximum number of guesses before a game is considered lost</synopsis> + </configOption> + </configObject> + </configFile> + </configInfo> ***/ static char *app = "SkelGuessNumber"; @@ -197,6 +242,7 @@ static void *skel_level_find(struct ao2_container *tmp_container, const char *ca /*! \brief An aco_type structure to link the "general" category to the skel_global_config type */ static struct aco_type global_option = { .type = ACO_GLOBAL, + .name = "globals", .item_offset = offsetof(struct skel_config, global), .category_match = ACO_WHITELIST, .category = "^general$", @@ -207,6 +253,7 @@ struct aco_type *global_options[] = ACO_TYPES(&global_option); /*! \brief An aco_type structure to link the "sounds" category to the skel_global_config type */ static struct aco_type sound_option = { .type = ACO_GLOBAL, + .name = "sounds", .item_offset = offsetof(struct skel_config, global), .category_match = ACO_WHITELIST, .category = "^sounds$", @@ -217,6 +264,7 @@ struct aco_type *sound_options[] = ACO_TYPES(&sound_option); /*! \brief An aco_type structure to link the everything but the "general" and "sounds" categories to the skel_level type */ static struct aco_type level_option = { .type = ACO_ITEM, + .name = "level", .category_match = ACO_BLACKLIST, .category = "^(general|sounds)$", .item_alloc = skel_level_alloc, |