You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ksql
7
7
**Is a JSON data expression lexer, parser, cli and library.**
8
8
9
9
#### Requirements
10
-
- Go 1.18+
10
+
- Go 1.19+
11
11
12
12
#### How to install CLI
13
13
```shell
@@ -85,14 +85,16 @@ Expressions support most mathematical and string expressions see below for detai
85
85
|`EndsWith`|`ENDSWITH `| Ends with whitespace blank space. |
86
86
|`NULL`|`NULL`| N/A |
87
87
|`Coerce`|`COERCE`| Coerces one data type into another using in combination with 'Identifier'. Syntax is `COERCE <expression> _identifer_`. |
88
-
|`Identifier`|`_identifier_`| Starts and end with an `_` used with 'COERCE' to cast data types. see below for options. |
88
+
|`Identifier`|`_identifier_`| Starts and end with an `_` used with 'COERCE' to cast data types, see table below with supported values. You can combine multiple coercions if separated by a COMMA.|
Copy file name to clipboardExpand all lines: cmd/ksql/main.go
+67-24Lines changed: 67 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@ package main
3
3
import (
4
4
"bufio"
5
5
"encoding/json"
6
+
"flag"
6
7
"fmt"
7
8
"os"
8
9
@@ -11,35 +12,62 @@ import (
11
12
)
12
13
13
14
funcmain() {
14
-
args:=os.Args[1:]
15
+
16
+
varoutputOriginalbool
17
+
flag.BoolVar(&outputOriginal, "o", false, "Indicates if the original data will be output after applying the expression. The results of the expression MUST be a boolean otherwise the output will be ignored.")
18
+
flag.Usage=usage
19
+
flag.Parse()
20
+
15
21
isPipe:=isInputFromPipe()
16
-
if (len(args) <2&&!isPipe) || (len(args) <1&&isPipe) {
17
-
usage()
22
+
if (flag.NArg() <2&&!isPipe) || (flag.NArg() <1&&isPipe) {
0 commit comments