Parcourir la source

Add function to create entry object

 + Other for other types will follow
Leo il y a 8 ans
Parent
commit
9fe01055cf
2 fichiers modifiés avec 11 ajouts et 0 suppressions
  1. 8 0
      src/rc.ml
  2. 3 0
      src/rc.mli

+ 8 - 0
src/rc.ml

@@ -253,6 +253,14 @@ let init ?(rc=(!Const.rc_file)) () =
     initializer self#write
   end;;
 
+let create_entry ~cmd ?(tags=[]) = object
+    val command = cmd
+    val tags = tags
+    method command = command
+    method tags = tags
+end;;
+let create_tag = failwith "Not implemented"
+let create_setting = failwith "Not implemented"
 (*
    (* Tools to create new tag *)
    class enpty_tag = object

+ 3 - 0
src/rc.mli

@@ -76,3 +76,6 @@ type t = <
 >;;
 
 val init : ?rc:string lazy_t -> unit -> t
+
+(* Create corresponding object *)
+val create_entry : cmd:string -> ?tags:tag list -> entry