pike.git
/
CHANGES
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/CHANGES:536:
ADT.Set implements a datatype for sets. These sets behave much like multisets, except that they are restricted to containing only one instance of each member value. From a performance viewpoint, it is probably more efficient for a Pike program to use mappings to serve as sets, rather than using an ADT.Set,so ADT.Set is mainly provided for the sake of completeness and code readability. o Arg
+
The new argument parser module allows for Getopt style arugment
+
parsing, but with a much simpler and object oriented API.
-
+
class Parser
+
{
+
inherit Arg.Options;
+
Opt verbose = NoOpt("-v")|NoOpt("--verbose")|Env("VERBOSE");
+
Opt name = HasOpt("-f")|HasOpt("--file")|Default("out");
+
Opt debug = MaybeOpt("-d")|MaybeOpt("--debug");
+
}
+
+
void main(int argc, array(string) argv)
+
{
+
Parser p = Parser(argv);
+
werror("name: %O, verbose: %O, debug: %O\n",
+
p->name, p->verbose, p->debug);
+
}
+
+
A more simplistic interface is also available for smaller hacks and
+
programs.
+
+
void main(int argc, array(string) argv)
+
{
+
mapping opts = Arg.parse(argv);
+
argv = opts[Arg.REST];
+
}
+
o Protocols.DNS_SD This module provides an interface to DNS Service Discovery. The functionality of DNS-SD is described at <http://www.dns-sd.org/>. Using the Proctocols.DNS_SD.Service class a Pike program can announce services, for example a web site or a database server, to computers on the local network. When registering a service you need to provide the service name. service type, domain and port number. You can also optionally