From f2f528ee4111153d7fee066600fbb0c3b2a265fb Mon Sep 17 00:00:00 2001 From: John Kerl Date: Sat, 25 Dec 2021 14:30:58 -0500 Subject: [PATCH] more doc-neatens re windows and mlr -s --- docs/src/miller-on-windows.md | 2 ++ docs/src/miller-on-windows.md.in | 2 ++ docs/src/scripting.md | 50 +++++++++++++++++++++++++++++++- docs/src/scripting.md.in | 14 ++++++++- todo.txt | 1 - 5 files changed, 66 insertions(+), 3 deletions(-) diff --git a/docs/src/miller-on-windows.md b/docs/src/miller-on-windows.md index 64541be27..38f1e5486 100644 --- a/docs/src/miller-on-windows.md +++ b/docs/src/miller-on-windows.md @@ -55,3 +55,5 @@ One workaround is to use MSYS2. Another workaround is to put more complex DSL ex A third workaround is to replace `"` with `"""`, then `'` with `"`: ![pix/miller-windows-triple-double-quote.png](pix/miller-windows-triple-double-quote.png) + +A fourth workaround is `mlr -s`: see [Scripting with Miller](scripting.md). diff --git a/docs/src/miller-on-windows.md.in b/docs/src/miller-on-windows.md.in index a28d267fe..c03ee4843 100644 --- a/docs/src/miller-on-windows.md.in +++ b/docs/src/miller-on-windows.md.in @@ -39,3 +39,5 @@ One workaround is to use MSYS2. Another workaround is to put more complex DSL ex A third workaround is to replace `"` with `"""`, then `'` with `"`: ![pix/miller-windows-triple-double-quote.png](pix/miller-windows-triple-double-quote.png) + +A fourth workaround is `mlr -s`: see [Scripting with Miller](scripting.md). diff --git a/docs/src/scripting.md b/docs/src/scripting.md index 3efce1260..8757df9d5 100644 --- a/docs/src/scripting.md +++ b/docs/src/scripting.md @@ -105,6 +105,22 @@ circle 3 0.3 } +
+example-shell-script --ojson then filter '$count == 3' example.csv
+
+
+{
+  "shape": "triangle",
+  "count": 3,
+  "count_fraction": 0.3
+}
+{
+  "shape": "circle",
+  "count": 3,
+  "count_fraction": 0.3
+}
+
+ etc. ## Miller scripts @@ -173,6 +189,22 @@ circle 3 0.3 } +
+example-mlr-s-script --ojson then filter '$count == 3' example.csv
+
+
+{
+  "shape": "triangle",
+  "count": 3,
+  "count_fraction": 0.3
+}
+{
+  "shape": "circle",
+  "count": 3,
+  "count_fraction": 0.3
+}
+
+ ## Miller scripts on Windows Both the previous options require executable mode with `chmod`, and a _shebang @@ -230,4 +262,20 @@ circle 3 0.3 } -and so on. +
+mlr -s example-mlr-s-script-no-shebang --ojson then filter '$count == 3' example.csv
+
+
+{
+  "shape": "triangle",
+  "count": 3,
+  "count_fraction": 0.3
+}
+{
+  "shape": "circle",
+  "count": 3,
+  "count_fraction": 0.3
+}
+
+ +and so on. See also [Miller on Windows](miller-on-windows.md). diff --git a/docs/src/scripting.md.in b/docs/src/scripting.md.in index b06e952d9..6ab7933ec 100644 --- a/docs/src/scripting.md.in +++ b/docs/src/scripting.md.in @@ -46,6 +46,10 @@ GENMD-RUN-COMMAND example-shell-script --ojson example.csv GENMD-EOF +GENMD-RUN-COMMAND +example-shell-script --ojson then filter '$count == 3' example.csv +GENMD-EOF + etc. ## Miller scripts @@ -78,6 +82,10 @@ GENMD-RUN-COMMAND example-mlr-s-script --ojson example.csv GENMD-EOF +GENMD-RUN-COMMAND +example-mlr-s-script --ojson then filter '$count == 3' example.csv +GENMD-EOF + ## Miller scripts on Windows Both the previous options require executable mode with `chmod`, and a _shebang @@ -106,4 +114,8 @@ GENMD-RUN-COMMAND mlr -s example-mlr-s-script-no-shebang --ojson example.csv GENMD-EOF -and so on. +GENMD-RUN-COMMAND +mlr -s example-mlr-s-script-no-shebang --ojson then filter '$count == 3' example.csv +GENMD-EOF + +and so on. See also [Miller on Windows](miller-on-windows.md). diff --git a/todo.txt b/todo.txt index 58a9b3be0..ace2f5e36 100644 --- a/todo.txt +++ b/todo.txt @@ -9,7 +9,6 @@ PUNCHDOWN LIST - license triple-checks - `mlr put` -> coverart - 0b1011 olh/webdoc - - shebang - big-picture note ? array/map fields: marshal as JSON_SINGLE_LINE