Feature #1354
closedAdd command line option to list registered configuration options
Description
Add a command line option that causes lighttpd to list all of the configuration options that are registered by the loaded modules during startup - essentially dumping the information contained in the config_values_t structures in human readable form.
This will provide a quick reference for users, and allow those wishing to contribute to the documentation to quickly check for gaps. It will also allow those testing trunk releases to find and test new features.
Updated by darix about 17 years ago
i have written an ruby script for that. maybe i should publish it in svn.
Updated by gstrauss over 8 years ago
- Description updated (diff)
- Assignee deleted (
jan) - Priority changed from Normal to Low
While a good idea, doing so would be a major effort involving touching all modules. In some cases, strings are parsed into structured data, and this structured data would need to be converted back to user-friendly string labels, as opposed to enum values that have little meaning outside the code.
Updated by gstrauss almost 8 years ago
The following one-line patch will print registered config keys to error log at startup. Not intended for production, but just spams the error log at startup. It does not print the module name with each config_values_t. Doing so suggests having each module SETDEFAULTS_FUNC check for a flag and print the keys from the config_values_t cv[] list.
--- a/src/configfile-glue.c +++ b/src/configfile-glue.c @@ -194,6 +194,7 @@ int config_insert_values_global(server *srv, array *ca, const config_values_t cv for (i = 0; cv[i].key; i++) { data_string *touched; + log_error_write(srv, __FILE__, __LINE__, "s", cv[i].key); if (NULL == (du = array_get_element(ca, cv[i].key))) { /* no found */
This seems more like a maintainer-mode feature, perhaps enabled with a build flag, than it does a command line switch in production builds.
Is there still interest in this feature? If so, please describe in slightly more detail the expected "human readable" output.
Updated by gstrauss almost 8 years ago
- Status changed from New to Fixed
- Target version set to 1.4.x
Actually, this is pretty easy to do with a Perl one-liner
perl -e '$/=undef; foreach $file (@ARGV) { next unless open($FH,"<",$file); print "\n$file\n\n$1\n" while (<$FH> =~ /([ \t]*config_values_t cv[^;]+;)/gs); }' src/*.[chy]
Updated by gstrauss almost 8 years ago
- Target version changed from 1.4.x to 1.4.45
Also available in: Atom