#define MODE_DUMP_LIBS 0x2000 /* dump loaded libraries at the end of init phase */
#define MODE_DUMP_KWD 0x4000 /* dump registered keywords (see kwd_dump for the list) */
#define MODE_DUMP_CFG 0x8000 /* dump the configure file */
+#define MODE_DUMP_NB_L 0x10000 /* dump line numbers when the configuration file is dump */
/* list of last checks to perform, depending on config options */
#define LSTCHK_CAP_BIND 0x00000001 /* check that we can bind to any port */
int i = 0;
uint32_t g_key = HA_ATOMIC_LOAD(&global.anon_key);
- qfprintf(stdout, "%d\t", linenum);
+ if (global.mode & MODE_DUMP_NB_L)
+ qfprintf(stdout, "%d\t", linenum);
/* if a word is in sections list, is_sect = 1 */
list_for_each_entry(sect, §ions, list) {
" -N sets the default, per-proxy maximum # of connections (%d)\n"
" -L set local peer name (default to hostname)\n"
" -p writes pids of all children to this file\n"
- " -dC[key] display the configure file, if there is a key, the file will be anonymise\n"
+ " -dC[[key],line] display the configuration file, if there is a key, the file will be anonymised\n"
#if defined(USE_EPOLL)
" -de disables epoll() usage even when available\n"
#endif
else if (*flag == 'V')
arg_mode |= MODE_VERBOSE;
else if (*flag == 'd' && flag[1] == 'C') {
+ char *end;
+ char *key;
+
+ key = flag + 2;
+ for (;key && *key; key = end) {
+ end = strchr(key, ',');
+ if (end)
+ *(end++) = 0;
+
+ if (strcmp(key, "line") == 0)
+ arg_mode |= MODE_DUMP_NB_L;
+
+ }
arg_mode |= MODE_DUMP_CFG;
HA_ATOMIC_STORE(&global.anon_key, atoll(flag + 2));
}
global.mode |= (arg_mode & (MODE_DAEMON | MODE_MWORKER | MODE_FOREGROUND | MODE_VERBOSE
| MODE_QUIET | MODE_CHECK | MODE_DEBUG | MODE_ZERO_WARNING
- | MODE_DIAG | MODE_CHECK_CONDITION | MODE_DUMP_LIBS | MODE_DUMP_KWD | MODE_DUMP_CFG));
+ | MODE_DIAG | MODE_CHECK_CONDITION | MODE_DUMP_LIBS | MODE_DUMP_KWD
+ | MODE_DUMP_CFG | MODE_DUMP_NB_L));
if (getenv("HAPROXY_MWORKER_WAIT_ONLY")) {
unsetenv("HAPROXY_MWORKER_WAIT_ONLY");