#!/usr/bin/perl
# $Id: GetConf,v 1.3 2000/08/04 15:05:31 macgyver Exp $
#
# GetConf: Obtain a list of all ProFTPD configuration directives.
# Author: MacGyver aka Habeeb J. Dihu <macgyver@tos.net>
# Copyright(C) 1999, 2000, MacGyver.  All Rights Reserved.
#

use strict;

my $arg;

foreach $arg (sort @ARGV) {
    open(FILE, $arg) || die("Unable to open $arg: $!");
    
    while(<FILE>) {
	next unless /^\s*static\s*conftable\s*([^\s_]*)_.*/;

	print "Module $1:\n";
	
	while(<FILE>) {
	    last if /\}\;/;
	    
	    if(/\{\s*"(.*)".*\}/) {
		print "  $1\n";
	    }
	}
	
	print "\n";
    }
    
    close(FILE);
}

