From edbfcdbed086b263c81bb6582a1f57b7cf927a2b Mon Sep 17 00:00:00 2001 From: John Kerl Date: Tue, 8 Mar 2016 21:44:10 -0800 Subject: [PATCH] doc neatens --- c/todo.txt | 1 - doc/content-for-file-formats.html | 2 ++ doc/data/system-file-ojson-example.txt | 22 +++++++++++++++++++ doc/file-formats.html | 29 ++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 doc/data/system-file-ojson-example.txt diff --git a/c/todo.txt b/c/todo.txt index 4356a6872..410f6b5d9 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -9,7 +9,6 @@ TOP-OF-LIST SUMMARY ? make a 3.5.0 with nest, shuffle, & cat -n bugfix? * rh/fedora/centos mlr-3.4.0 -* \" in string-literal reader ... fix up in the parser or in rval_expr. * basenaming syntax for subselector emits ~ oosvar-to-oosvar assignments with treecopy ~ subselector emits diff --git a/doc/content-for-file-formats.html b/doc/content-for-file-formats.html index 2e0e9a465..a2eb0ed10 100644 --- a/doc/content-for-file-formats.html +++ b/doc/content-for-file-formats.html @@ -227,5 +227,7 @@ for an entirely different, very powerful option). Namely: POKI_INCLUDE_ESCAPED(data/system-file-opprint-example.txt)HERE POKI_INCLUDE_ESCAPED(data/system-file-oxtab-example.txt)HERE + +POKI_INCLUDE_ESCAPED(data/system-file-ojson-example.txt)HERE diff --git a/doc/data/system-file-ojson-example.txt b/doc/data/system-file-ojson-example.txt new file mode 100644 index 000000000..029450caf --- /dev/null +++ b/doc/data/system-file-ojson-example.txt @@ -0,0 +1,22 @@ +$ grep -v '^#' /etc/passwd | head -n 2 | \ + mlr --nidx --fs : --ojson --jvstack --jlistwrap label name,password,uid,gid,gecos,home_dir,shell +[ +{ + "name": "nobody", + "password": "*", + "uid": -2, + "gid": -2, + "gecos": "Unprivileged User", + "home_dir": "/var/empty", + "shell": "/usr/bin/false" +} +,{ + "name": "root", + "password": "*", + "uid": 0, + "gid": 0, + "gecos": "System Administrator", + "home_dir": "/var/root", + "shell": "/bin/sh" +} +] diff --git a/doc/file-formats.html b/doc/file-formats.html index 3ef5bd352..7d1e034d2 100644 --- a/doc/file-formats.html +++ b/doc/file-formats.html @@ -684,6 +684,35 @@ $ grep -v '^#' /etc/passwd | head -n 2 | mlr --nidx --fs : --oxtab cat

+ +

+

+
+$ grep -v '^#' /etc/passwd | head -n 2 | \
+  mlr --nidx --fs : --ojson --jvstack --jlistwrap label name,password,uid,gid,gecos,home_dir,shell
+[
+{
+  "name": "nobody",
+  "password": "*",
+  "uid": -2,
+  "gid": -2,
+  "gecos": "Unprivileged User",
+  "home_dir": "/var/empty",
+  "shell": "/usr/bin/false"
+}
+,{
+  "name": "root",
+  "password": "*",
+  "uid": 0,
+  "gid": 0,
+  "gecos": "System Administrator",
+  "home_dir": "/var/root",
+  "shell": "/bin/sh"
+}
+]
+
+
+