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
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,8 @@ Like `binary.Read`, but a bit different and without reflection.
13
13
array of arrays and slice of arrays are not supported right now)
14
14
- no reflection in generated code, it is simple and fast
15
15
- possibility to select type[s] to serialize via `-types` CLI flag
16
-
- possibility to select output function names (and exportability, as implied by Go)
16
+
- customize output function names
17
+
- customize output file name
17
18
18
19
### Advanced
19
20
- slice field length can be set to any expression that returns `int`, by using tags. Currently [de]serialized instance can be referred to as "`o`", within expression.
@@ -30,10 +31,11 @@ Remember that only fields that get read _before_ the slice field will have meani
30
31
31
32
-`-types` (required): can be a comma-separated list of types you want to process, or reserved keyword `all` for processing all top-level `struct`s, found in file.
32
33
`all` usage and requiredness of the argument can change in the future.
34
+
-`-output` (optional): set output file name.
33
35
34
36
#### Custom
35
37
36
-
`//go:generate go run github.com/am4n0w4r/simser -types=Header -read-fn-name=customReadFnName -write-fn-name=CustomWriteFnName`
38
+
`//go:generate go run github.com/am4n0w4r/simser -types=Header -output=file.name -read-fn-name=customReadFnName -write-fn-name=CustomWriteFnName`
37
39
38
40
-`-read-fn-name` (optional): custom name for deserializing function. Is set per-file.
39
41
-`-write-fn-name` (optional): custom name for deserializing function. Is set per-file.
0 commit comments