Project

General

Profile

Feature #1354

Add command line option to list registered configuration options

Added by jrabbit over 12 years ago. Updated about 3 years ago.

Status:
Fixed
Priority:
Low
Assignee:
-
Category:
core
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Missing in 1.5.x:

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.

#1

Updated by darix over 12 years ago

i have written an ruby script for that. maybe i should publish it in svn.

#2

Updated by gstrauss over 3 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.

#3

Updated by gstrauss over 3 years ago

  • Target version deleted (1.5.0)
#4

Updated by gstrauss about 3 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.

#5

Updated by gstrauss about 3 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]

#6

Updated by gstrauss about 3 years ago

  • Target version changed from 1.4.x to 1.4.45

Also available in: Atom