OCaml: Add separate logging channels and a dedicated 'command' type
This commit is contained in:
parent
fab7e2425a
commit
ac3dbe4d30
9 changed files with 72 additions and 36 deletions
13
ocaml/lib/system/process/command.ml
Normal file
13
ocaml/lib/system/process/command.ml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
open Utilities.Aliases
|
||||
|
||||
type status = Exit of int | Unevaluated
|
||||
type command = { name: string; arguments: string list; status: status }
|
||||
|
||||
let format (command: command): string =
|
||||
command.name ^
|
||||
" with arguments: " ^ (String.concat " " command.arguments) ^
|
||||
" and result " ^ match command.status with
|
||||
| Exit n -> str_int n
|
||||
| Unevaluated -> "Not evaluated"
|
||||
|
||||
let format_many (commands: command list): string list = List.map format commands
|
||||
Loading…
Add table
Add a link
Reference in a new issue