[Gd-chatter] r11189 - in trunk/libraries: network/koala/sources/koala sniffer utilities/getopt
hannes at gwydiondylan.org
hannes at gwydiondylan.org
Sun Feb 18 22:07:16 CET 2007
Author: hannes
Date: Sun Feb 18 22:07:14 2007
New Revision: 11189
Modified:
trunk/libraries/network/koala/sources/koala/koala-main.dylan
trunk/libraries/sniffer/sniffer.dylan
trunk/libraries/utilities/getopt/defargparser.dylan
trunk/libraries/utilities/getopt/getopt-exports.dylan
trunk/libraries/utilities/getopt/getopt.dylan
Log:
Job: minor
revert last commit;
make print-synopsis open, and unify signature of macro-generated ?fn and print-synopsis
Modified: trunk/libraries/network/koala/sources/koala/koala-main.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/koala/koala-main.dylan (original)
+++ trunk/libraries/network/koala/sources/koala/koala-main.dylan Sun Feb 18 22:07:14 2007
@@ -54,7 +54,7 @@
let desc = "The Koala web server, a multi-threaded web server with\n"
"Dylan Server Pages and XML RPC, written in Dylan.";
print-synopsis(parser,
- stream: *standard-output*,
+ *standard-output*,
usage: "koala [options]",
description: desc);
exit-application(0);
Modified: trunk/libraries/sniffer/sniffer.dylan
==============================================================================
--- trunk/libraries/sniffer/sniffer.dylan (original)
+++ trunk/libraries/sniffer/sniffer.dylan Sun Feb 18 22:07:14 2007
@@ -3,7 +3,7 @@
Copyright: (C) 2005, 2006, All rights reserved. Free for non-commercial use.
define argument-parser <sniffer-argument-parser> ()
- synopsis print-usage,
+ synopsis print-synopsis,
usage: "sniffer [options]",
description: "Capture and display packets from a network interface.";
option verbose?, "Verbose output, print whole packet",
@@ -23,7 +23,7 @@
define function main()
let parser = make(<sniffer-argument-parser>);
unless(parse-arguments(parser, application-arguments()))
- print-usage(parser, *standard-output*);
+ print-synopsis(parser, *standard-output*);
exit-application(0);
end;
let input-stream = if (parser.read-pcap)
Modified: trunk/libraries/utilities/getopt/defargparser.dylan
==============================================================================
--- trunk/libraries/utilities/getopt/defargparser.dylan (original)
+++ trunk/libraries/utilities/getopt/defargparser.dylan Sun Feb 18 22:07:14 2007
@@ -357,7 +357,7 @@
(?fn:name, ?usage:expression, ?description:expression)
?options
end }
- => { define method ?fn (parser :: ?name, stream :: <stream>) => ();
+ => { define method ?fn (parser :: ?name, stream :: <stream>, #key) => ();
let usage = ?usage;
let desc = ?description;
if (usage) format(stream, "Usage: %s\n", usage); end if;
Modified: trunk/libraries/utilities/getopt/getopt-exports.dylan
==============================================================================
--- trunk/libraries/utilities/getopt/getopt-exports.dylan (original)
+++ trunk/libraries/utilities/getopt/getopt-exports.dylan Sun Feb 18 22:07:14 2007
@@ -70,7 +70,6 @@
define module getopt
use common-dylan, exclude: { format-to-string };
use option-parser-protocol;
- use standard-io;
export
<argument-list-parser>,
Modified: trunk/libraries/utilities/getopt/getopt.dylan
==============================================================================
--- trunk/libraries/utilities/getopt/getopt.dylan (original)
+++ trunk/libraries/utilities/getopt/getopt.dylan Sun Feb 18 22:07:14 2007
@@ -416,12 +416,14 @@
end block;
end function parse-arguments;
+define open generic print-synopsis
+ (parser :: <argument-list-parser>, stream :: <stream>, #key);
// todo -- Generate the initial "Usage: ..." line as well.
define method print-synopsis
(parser :: <argument-list-parser>,
- #key stream :: <stream> = *standard-output*,
- usage :: false-or(<string>),
+ stream :: <stream>,
+ #key usage :: false-or(<string>),
description :: false-or(<string>))
if (usage) format(stream, "Usage: %s\n", usage); end;
if (description) format(stream, "%s\n", description); end;
More information about the chatter
mailing list