| 1 |
(**************************************************************************) |
| 2 |
(* *) |
| 3 |
(* Copyright 2012-2019 OCamlPro *) |
| 4 |
(* Copyright 2012 INRIA *) |
| 5 |
(* *) |
| 6 |
(* All rights reserved. This file is distributed under the terms of the *) |
| 7 |
(* GNU Lesser General Public License version 2.1, with the special *) |
| 8 |
(* exception on linking described in the file LICENSE. *) |
| 9 |
(* *) |
| 10 |
(**************************************************************************) |
| 11 |
|
| 12 |
(* Stubbed-out console file. |
| 13 |
Dune never wants OPAM to print anything, so every value in the interface |
| 14 |
is replaced by a no-op stub *) |
| 15 |
|
| 16 |
let debug () = false |
| 17 |
|
| 18 |
let verbose () = false |
| 19 |
|
| 20 |
let color () = false |
| 21 |
|
| 22 |
let disp_status_line () = false |
| 23 |
|
| 24 |
let utf8, utf8_extended = (fun () -> false), (fun () -> false) |
| 25 |
|
| 26 |
module Symbols = struct |
| 27 |
let rightwards_arrow = Uchar.min |
| 28 |
let box_drawings_light_down_and_right = Uchar.min |
| 29 |
let box_drawings_light_horizontal = Uchar.min |
| 30 |
let box_drawings_light_vertical = Uchar.min |
| 31 |
let box_drawings_light_up_and_right = Uchar.min |
| 32 |
let box_drawings_light_right = Uchar.min |
| 33 |
let circled_division_slash = Uchar.min |
| 34 |
let asterisk_operator = Uchar.min |
| 35 |
let north_east_arrow = Uchar.min |
| 36 |
let south_east_arrow = Uchar.min |
| 37 |
let clockwise_open_circle_arrow = Uchar.min |
| 38 |
let greek_small_letter_lambda = Uchar.min |
| 39 |
let latin_capital_letter_o_with_stroke = Uchar.min |
| 40 |
let six_pointed_black_star = Uchar.min |
| 41 |
let upwards_arrow = Uchar.min |
| 42 |
let downwards_arrow = Uchar.min |
| 43 |
let up_down_arrow = Uchar.min |
| 44 |
let downwards_double_arrow = Uchar.min |
| 45 |
let black_down_pointing_triangle = Uchar.min |
| 46 |
let downwards_black_arrow = Uchar.min |
| 47 |
end |
| 48 |
|
| 49 |
let utf8_symbol _main ?alternates:_ s = s |
| 50 |
|
| 51 |
let timer () () = 0. |
| 52 |
|
| 53 |
type text_style = |
| 54 |
[ `bold |
| 55 |
| `underline |
| 56 |
| `crossed |
| 57 |
| `black |
| 58 |
| `red |
| 59 |
| `green |
| 60 |
| `yellow |
| 61 |
| `blue |
| 62 |
| `magenta |
| 63 |
| `cyan |
| 64 |
| `white ] |
| 65 |
|
| 66 |
(* not nestable *) |
| 67 |
let colorise _style s = s |
| 68 |
|
| 69 |
let colorise' _styles s = s |
| 70 |
|
| 71 |
let acolor c () = colorise c |
| 72 |
let acolor_w _width _c _f _s = () |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
let carriage_delete () = () |
| 77 |
|
| 78 |
let clear_status () = () |
| 79 |
|
| 80 |
let log _section ?level:_ fmt = |
| 81 |
let null_formatter = Format.make_formatter (fun _ _ _ -> ()) (fun () -> ()) in |
| 82 |
Format.ifprintf null_formatter fmt |
| 83 |
|
| 84 |
let slog _to_string _f _x = () |
| 85 |
|
| 86 |
let error fmt = |
| 87 |
Printf.ifprintf () fmt |
| 88 |
|
| 89 |
let warning fmt = |
| 90 |
Printf.ifprintf () fmt |
| 91 |
|
| 92 |
let note fmt = |
| 93 |
Printf.ifprintf () fmt |
| 94 |
|
| 95 |
let errmsg fmt = |
| 96 |
Printf.ifprintf () fmt |
| 97 |
|
| 98 |
let error_and_exit _reason fmt = |
| 99 |
Printf.ikfprintf (fun () -> failwith "never") () fmt |
| 100 |
|
| 101 |
let msg fmt = |
| 102 |
Printf.ifprintf () fmt |
| 103 |
|
| 104 |
let formatted_msg ?indent:_ fmt = |
| 105 |
Printf.ifprintf () fmt |
| 106 |
|
| 107 |
let status_line fmt = |
| 108 |
Printf.ifprintf () fmt |
| 109 |
|
| 110 |
let header_msg fmt = |
| 111 |
Printf.ifprintf () fmt |
| 112 |
|
| 113 |
let header_error fmt = |
| 114 |
Printf.ikfprintf (fun () -> failwith "never") () fmt |
| 115 |
|
| 116 |
let pause fmt = |
| 117 |
Printf.ifprintf () fmt |
| 118 |
|
| 119 |
let confirm ?require_unsafe_yes:_ ?default:_ fmt = |
| 120 |
Printf.ikfprintf (fun () -> false) () fmt |
| 121 |
|
| 122 |
let read fmt = |
| 123 |
Printf.ikfprintf (fun () -> None) () fmt |
| 124 |
|
| 125 |
let print_table ?cut:_ _oc ~sep:_ _table = () |
| 126 |
|
| 127 |
let menu ?default:_ ?unsafe_yes:_ ?yes:_ ~no:_ ~options:_ fmt = |
| 128 |
Printf.ikfprintf (fun () -> failwith "never") () fmt |
| 129 |
|
| 130 |
(** Tree printing *) |
| 131 |
module Tree = struct |
| 132 |
|
| 133 |
type 'elt t = 'elt |
| 134 |
|
| 135 |
let value x = x |
| 136 |
let children _ = [] |
| 137 |
|
| 138 |
let create ?children:_ value = value |
| 139 |
|
| 140 |
type symbols = { |
| 141 |
vert: string; |
| 142 |
hor: string; |
| 143 |
tee: string; |
| 144 |
hook: string; |
| 145 |
} |
| 146 |
|
| 147 |
let get_default_symbols () = |
| 148 |
{ vert=""; hor=""; tee=""; hook="" } |
| 149 |
|
| 150 |
let print ?symbols:_ ~printer:_ _ = () |
| 151 |
end |