aboutsummaryrefslogtreecommitdiff
path: root/lib/flags.ml
diff options
context:
space:
mode:
authorherbelin2009-01-18 20:56:21 +0000
committerherbelin2009-01-18 20:56:21 +0000
commit85237f65161cb9cd10119197c65c84f65f0262ee (patch)
tree263ba9669e047ea32cf6734a878d747e26c7f2be /lib/flags.ml
parent05b31844f683c3bc81b371c94be5cc6f6f4edf61 (diff)
Backporting from v8.2 to trunk:
- Filtering of doc compilation messages (11793,11795,11796). - Fixing bug #1925 and cleaning around bug #1894 (11796, 11801). - Adding some tests. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@11802 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/flags.ml')
-rw-r--r--lib/flags.ml17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/flags.ml b/lib/flags.ml
index c3033c4b5c..c0af148c70 100644
--- a/lib/flags.ml
+++ b/lib/flags.ml
@@ -13,6 +13,11 @@ let with_option o f x =
try let r = f x in o := old; r
with e -> o := old; raise e
+let without_option o f x =
+ let old = !o in o:=false;
+ try let r = f x in o := old; r
+ with e -> o := old; raise e
+
let boot = ref false
let batch_mode = ref false
@@ -44,16 +49,8 @@ let make_silent flag = silent := flag; ()
let is_silent () = !silent
let is_verbose () = not !silent
-let silently f x =
- let oldsilent = !silent in
- try
- silent := true;
- let rslt = f x in
- silent := oldsilent;
- rslt
- with e -> begin
- silent := oldsilent; raise e
- end
+let silently f x = with_option silent f x
+let verbosely f x = without_option silent f x
let if_silent f x = if !silent then f x
let if_verbose f x = if not !silent then f x