Commit a6b3746c authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2003-05-24 22:27:34 by cvscast] Beppe: added options and modified so to have gnu-syntax

Original author: cvscast
Date: 2003-05-24 22:27:34+00:00
parent b6f8d10a
...@@ -112,10 +112,10 @@ include depend ...@@ -112,10 +112,10 @@ include depend
# CDuce-generated files # CDuce-generated files
driver/examples.ml: cduce web/examples/build.cd web/examples/examples.xml driver/examples.ml: cduce web/examples/build.cd web/examples/examples.xml
(cd web/examples; ../../cduce -quiet build.cd) (cd web/examples; ../../cduce --quiet build.cd)
web/files: cduce web/site.cd web/files: cduce web/site.cd
(cd web; ../cduce -quiet site.cd -- -php site.xml) (cd web; ../cduce --quiet site.cd --arg -php site.xml)
# Packaging # Packaging
...@@ -162,7 +162,7 @@ website: web/files ...@@ -162,7 +162,7 @@ website: web/files
scp web/www/*.php web/cduce.css cduce@iris:public_html/ scp web/www/*.php web/cduce.css cduce@iris:public_html/
local_website: cduce local_website: cduce
(cd web; ../cduce -quiet site.cd -- site.xml) (cd web; ../cduce --quiet site.cd --arg site.xml)
# Distribution # Distribution
......
...@@ -7,21 +7,33 @@ let src = ref [] ...@@ -7,21 +7,33 @@ let src = ref []
let args = ref [] let args = ref []
let specs = let specs =
[ "-dump", Arg.String (fun s -> dump := Some s), [ "--dump", Arg.String (fun s -> dump := Some s),
" specify filename for persistency"; " specify filename for persistency";
"-quiet", Arg.Set Cduce.quiet, "--quiet", Arg.Set Cduce.quiet,
"suppress normal output (typing, results)"; " suppress normal output (typing, results)";
"-v", Arg.Unit (fun () -> "-v", Arg.Unit (fun () ->
Printf.eprintf "CDuce, version %s\n" Printf.eprintf "CDuce, version %s\n"
Cduce.version; exit 0), Cduce.version; exit 0),
" print CDuce version"; " print CDuce version";
"--", Arg.Rest (fun s -> args := s :: !args), "--version", Arg.Unit (fun () ->
" the following argument are passed to the CDuce program (in argv)"; Printf.eprintf "CDuce, version %s\n"
Cduce.version; exit 0),
"print CDuce version";
"--licence", Arg.Unit (fun () ->
Printf.eprintf "\n\
The CDuce interpreter is distributed under the terms of the Q Public \n\
License version 1.0 (included in the sources). The Choice of Law section\n\
been modified from the original Q Public.\n\n
"; exit 0),
"print CDuce licence";
"--arg", Arg.Rest (fun s -> args := s :: !args),
" the arguments that follow are passed to the CDuce program (in argv)";
] ]
let () = let () =
Arg.parse specs (fun s -> src := s :: !src) Arg.parse specs (fun s -> src := s :: !src)
"cduce [options] [CDuce files] -- [arguments for the CDuce program]\n\nOptions:" "\nUsage:\ncduce [OPTIONS ...] [FILE ...] [--arg argument ...]\n\nOptions:"
let ppf = let ppf =
if !Cduce.quiet then Format.formatter_of_buffer (Buffer.create 1023) if !Cduce.quiet then Format.formatter_of_buffer (Buffer.create 1023)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment