*** frontend.ml.orig Tue Jul 15 03:45:35 2003 --- frontend.ml Tue Jul 15 03:44:22 2003 *************** *** 383,389 **** "-p-format", Arg.Unit (fun () -> format := p_format), " prints package names"; ] ! (fun p -> packages := !packages @ [p]) "usage: ocamlfind query [ -predicates

| -format | -long-format | -i-format | -l-format | -a-format | --- 383,389 ---- "-p-format", Arg.Unit (fun () -> format := p_format), " prints package names"; ] ! (fun p -> if !Arg.current > 1 then packages := !packages @ [p]) "usage: ocamlfind query [ -predicates

| -format | -long-format | -i-format | -l-format | -a-format | *************** *** 711,717 **** " Treat as a file name (even if it starts with `-')"; ] ]) ! (fun s -> pass_files := !pass_files @ [ Pass s]) ("usage: ocamlfind " ^ which ^ " [options] file ..."); begin match which with --- 711,717 ---- " Treat as a file name (even if it starts with `-')"; ] ]) ! (fun s -> if !Arg.current > 1 then pass_files := !pass_files @ [ Pass s]) ("usage: ocamlfind " ^ which ^ " [options] file ..."); begin match which with *************** *** 1100,1106 **** add_spec_fn "-pp" s), " Pipe sources through preprocessor "; ] ! (fun s -> pass_files := !pass_files @ [ s]) ("usage: ocamlfind ocamldep [options] file ..."); check_package_list !packages; --- 1100,1106 ---- add_spec_fn "-pp" s), " Pipe sources through preprocessor "; ] ! (fun s -> if !Arg.current > 1 then pass_files := !pass_files @ [ s]) ("usage: ocamlfind ocamldep [options] file ..."); check_package_list !packages; *************** *** 1183,1189 **** "-passopt", Arg.String (fun s -> pass_options := !pass_options @ [s]), " Pass option directly to ocamlbrowser"; ] ! (fun s -> raise (Arg.Bad ("Unexpected argument: " ^ s))) ("usage: ocamlfind ocamlbrowser [options] file ..."); if !add_all then packages := Fl_metacache_unix.list_packages(); --- 1183,1189 ---- "-passopt", Arg.String (fun s -> pass_options := !pass_options @ [s]), " Pass option directly to ocamlbrowser"; ] ! (fun s -> if !Arg.current > 1 then raise (Arg.Bad ("Unexpected argument: " ^ s))) ("usage: ocamlfind ocamlbrowser [options] file ..."); if !add_all then packages := Fl_metacache_unix.list_packages(); *************** *** 1345,1350 **** --- 1345,1351 ---- Arg.parse keywords (fun s -> + if !Arg.current <= 1 then () else if !pkgname = "" then pkgname := s else *************** *** 1501,1507 **** Arg.parse keywords (fun s -> ! if !pkgname = "" then pkgname := s else raise (Arg.Bad "too many arguments") ) --- 1502,1509 ---- Arg.parse keywords (fun s -> ! if !Arg.current <= 1 then () ! else if !pkgname = "" then pkgname := s else raise (Arg.Bad "too many arguments") ) *************** *** 1607,1613 **** Arg.parse keywords (fun s -> ! if !pkgname = "" then pkgname := s else files := s :: !files ) --- 1609,1616 ---- Arg.parse keywords (fun s -> ! if !Arg.current <= 1 then () ! else if !pkgname = "" then pkgname := s else files := s :: !files ) *************** *** 1657,1668 **** Arg.parse [] (fun s -> ! if !var <> None then raise(Arg.Bad "Unexpected argument"); ! match s with ("conf" | "path" | "destdir" | "metadir" | "stdlib" | "ldconf") -> var := Some s | _ -> raise(Arg.Bad "Bad argument"); ) errmsg; --- 1660,1673 ---- Arg.parse [] (fun s -> ! if !Arg.current > 1 then begin ! if !var <> None then raise(Arg.Bad "Unexpected argument"); ! match s with ("conf" | "path" | "destdir" | "metadir" | "stdlib" | "ldconf") -> var := Some s | _ -> raise(Arg.Bad "Bad argument"); + end ) errmsg;