diff options
Diffstat (limited to 'src/lib/util/options.c')
-rw-r--r-- | src/lib/util/options.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/lib/util/options.c b/src/lib/util/options.c index 7aa08ad0500..96315678471 100644 --- a/src/lib/util/options.c +++ b/src/lib/util/options.c @@ -124,6 +124,17 @@ void core_options::entry::set_default_value(const char *defvalue) } +//------------------------------------------------- +// set_description - set the description of +// an option +//------------------------------------------------- + +void core_options::entry::set_description(const char *description) +{ + m_description = description; +} + + void core_options::entry::set_flag(UINT32 mask, UINT32 flag) { m_flags = ( m_flags & mask ) | flag; @@ -299,6 +310,23 @@ void core_options::set_default_value(const char *name, const char *defvalue) //------------------------------------------------- +// set_description - change the description +// of an option +//------------------------------------------------- + +void core_options::set_description(const char *name, const char *description) +{ + // find the entry and bail if we can't + entry *curentry = m_entrymap.find(name); + if (curentry == NULL) + return; + + // update the data and default data + curentry->set_description(description); +} + + +//------------------------------------------------- // parse_command_line - parse a series of // command line arguments //------------------------------------------------- @@ -543,6 +571,17 @@ const char *core_options::value(const char *name) const //------------------------------------------------- +// description - return description of option +//------------------------------------------------- + +const char *core_options::description(const char *name) const +{ + entry *curentry = m_entrymap.find(name); + return (curentry != NULL) ? curentry->description() : ""; +} + + +//------------------------------------------------- // priority - return the priority of option //------------------------------------------------- |