From d8f2a1639ea9a092bcbee2fec2fca9aeedee3528 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 24 Sep 2007 04:24:54 +0000 Subject: [PATCH] 2247. [doc] Sort doc/misc/options. [RT #17067] --- CHANGES | 2 ++ doc/misc/Makefile.in | 3 ++- doc/misc/format-options.pl | 25 +++++++++++++++++++------ 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index ee4cd390c6..e5da3cae21 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +2247. [doc] Sort doc/misc/options. [RT #17067] + 2246. [bug] Make the startup of test servers (ans.pl) more robust. [RT #17147] diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in index 2546952ef5..a052682066 100644 --- a/doc/misc/Makefile.in +++ b/doc/misc/Makefile.in @@ -13,7 +13,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: Makefile.in,v 1.1.12.7 2007/08/28 07:19:12 tbox Exp $ +# $Id: Makefile.in,v 1.1.12.8 2007/09/24 04:24:54 marka Exp $ srcdir = @srcdir@ VPATH = @srcdir@ @@ -40,6 +40,7 @@ CFG_TEST = ../../bin/tests/cfg_test options: FORCE if test -x ${CFG_TEST} && \ ${CFG_TEST} --named --grammar | \ + ${PERL} ${srcdir}/sort-options.pl | \ ${PERL} ${srcdir}/format-options.pl >$@.new ; then \ mv -f $@.new $@ ; \ else \ diff --git a/doc/misc/format-options.pl b/doc/misc/format-options.pl index 5f0975ade8..46e6e07c33 100644 --- a/doc/misc/format-options.pl +++ b/doc/misc/format-options.pl @@ -15,7 +15,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: format-options.pl,v 1.1.206.1 2004/03/06 13:16:19 marka Exp $ +# $Id: format-options.pl,v 1.1.206.2 2007/09/24 04:24:54 marka Exp $ print <) { + chomp; s/\t/ /g; - if (length >= 79) { - m!^( *)!; - my $indent = $1; - s!^(.{0,75}) (.*)$!\1\n$indent \2!; + my $line = $_; + m!^( *)!; + my $indent = $1; + my $comment = ""; + if ( $line =~ m!//.*! ) { + $comment = $&; + $line =~ s!//.*!!; } - print; + my $start = ""; + while (length($line) >= 79 - length($comment)) { + $_ = $line; + # this makes sure that the comment has something in front of it + $len = 75 - length($comment); + m!^(.{0,$len}) (.*)$!; + $start = $start.$1."\n"; + $line = $indent." ".$2; + } + print $start.$line.$comment."\n"; }