Oz and Mozart Users Mailing List

Re: (none)


From: Denys Duchier (Denys.Duchier@ps.uni-sb.de)
Date: Mon Nov 19 2001 - 21:53:09 CET


asoletsky@yahoo.com (albert soletsky) writes:

> Appilcation module provides a powerful way for command
> line parsing, my question is:
> Is posible to use the Application.args function on
> strigs readed from a file?
> or exist another way to parsing configuration files?

ooh! that's an interesting extension. Indeed the argv parser should
be available first-class (that's really easy for us to provide).
Meanwhile, as it turns out, there is a detail of implentation which
you can take advantage of to achieve your aim: if you set property
'ozd.args' to a list of strings, it will be used as the argv argument
to the processor.

Thus, if your configuration file consists of one argument per line,
you can easily read it in, split on the newlines and Property.put the
result on 'ozd.args', then invoke Application.getCmdArgs.

But don't tell anybody. This is secret and "should not be used"(TM).

... oh... ooops!

Cheers,

-- 
Dr. Denys Duchier			Denys.Duchier@ps.uni-sb.de
Forschungsbereich Programmiersysteme	(Programming Systems Lab)
Universitaet des Saarlandes, Geb. 45	http://www.ps.uni-sb.de/~duchier
Postfach 15 11 50			Phone: +49 681 302 5618
66041 Saarbruecken, Germany		Fax:   +49 681 302 5615
-
Please send submissions to users@mozart-oz.org
and administriva mail to users-request@mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.



This archive was generated by hypermail 2b29.