diff options
-rw-r--r-- | src/session.ml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/session.ml b/src/session.ml index b5492ea..ee51c55 100644 --- a/src/session.ml +++ b/src/session.ml @@ -27,6 +27,20 @@ let make world = { changeset = [] } +let string_of_op op = + match op with + | CfgSet (path, value, _) -> + let path_str = Util.string_of_path path in + (match value with + | None -> Printf.sprintf "set %s" path_str + | Some v -> Printf.sprintf "set %s %s" path_str v) + | CfgDelete (path, value) -> + let path_str = Util.string_of_path path in + (match value with + | None -> Printf.sprintf "delete %s" path_str + | Some v -> Printf.sprintf "delete %s %s" path_str v) + + let set_modified s = if s.modified = true then s else {s with modified = true} |