diff options
author | Damien Doligez <damien.doligez-inria.fr> | 2003-06-19 18:13:31 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 2003-06-19 18:13:31 +0000 |
commit | 901936498a78d87d5d0dc507ed94cb7e81fdb50d (patch) | |
tree | 480eb04afa1013fbe852b13545c05257f3acfdaf /stdlib/arg.mli | |
parent | 510294058e4b37540e595b9abc1e43ef4464229a (diff) |
changement de parse_argv en cas d'erreur
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5604 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib/arg.mli')
-rw-r--r-- | stdlib/arg.mli | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/stdlib/arg.mli b/stdlib/arg.mli index 58d71e161..fa54cebc4 100644 --- a/stdlib/arg.mli +++ b/stdlib/arg.mli @@ -99,11 +99,20 @@ val parse_argv : string array -> (** [Arg.parse_argv args speclist anon_fun usage_msg] parses the array [args] as if it were the command line. It uses and updates the value of [Arg.current]. You must set [Arg.current] before calling - [parse_argv], and restore it afterward if needed. *) + [parse_argv], and restore it afterward if needed. + If an error occurs, [Arg.parse_argv] raises [Arg.Bad] with + the error message as argument. If option [-help] or [--help] is + given, [Arg.parse_argv] raises [Arg.Help] with the help message + as argument. +*) + +exception Help of string +(** Raised by [Arg.parse_argv] when the user asks for help. *) exception Bad of string (** Functions in [spec] or [anon_fun] can raise [Arg.Bad] with an error - message to reject invalid arguments. *) + message to reject invalid arguments. + [Arg.Bad] is also raised by [Arg.parse_argv] in case of an error. *) val usage : (key * spec * doc) list -> usage_msg -> unit (** [Arg.usage speclist usage_msg] prints an error message including |