From de7b65b61fb6e05cf964ce11dee1eca46efacf21 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Sun, 11 Mar 2018 00:43:01 +0000
Subject: [PATCH] Example use of load/cnflib.js (and cnfdefs.js)

---
 exec/dumpcnfs.js | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 exec/dumpcnfs.js

diff --git a/exec/dumpcnfs.js b/exec/dumpcnfs.js
new file mode 100644
index 0000000000..e70c1400d5
--- /dev/null
+++ b/exec/dumpcnfs.js
@@ -0,0 +1,22 @@
+// $Id$
+
+// Example use of cnflib.js
+// Changes to the objects may be written back to the files using cnf.write()
+// e.g.: cnflib.write("xtrn.cnf", undefined, xtrn_cnf);
+
+var cnflib = load({}, 'cnflib.js');
+
+print("msgs_cnf");
+var msgs_cnf = cnflib.read("msgs.cnf");
+if(msgs_cnf)
+	print(JSON.stringify(msgs_cnf, null, 4));
+
+print("xtrn_cnf");
+var xtrn_cnf = cnflib.read(system.ctrl_dir + "xtrn.cnf");
+if(xtrn_cnf)
+	print(JSON.stringify(xtrn_cnf, null, 4));
+
+print("file_cnf");
+var file_cnf = cnflib.read(system.ctrl_dir + "file.cnf");
+if(file_cnf)
+	print(JSON.stringify(file_cnf, null, 4));
-- 
GitLab