mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-17 16:38:54 +00:00
By default Miller does not infer booleans from data files: "true" and "false" (let alone "True", "yes", "on", etc.) are read as strings. This adds opt-in flags letting users specify exactly which field values should be inferred as boolean true/false when read from data files: mlr --infer-true True,yes,on --infer-false False,no,off ... Details: * Matching is exact and case-sensitive; unlisted values are unaffected. * As with ints and floats, the original string representation is retained for non-JSON output, so CSV/TSV/etc. round-trip unchanged. * JSON output emits canonical true/false (fixed marshalJSONBool to use the underlying boolean rather than the retained string, which would otherwise produce invalid JSON for e.g. "yes"). * Works with the -O and -A inference variants; -S (no inference) bypasses it, as it bypasses all other type inference. * Works from .mlrrc as infer-true/infer-false, like any other flag. Includes unit tests, regression-test cases under test/cases/io-infer-flags/, and doc updates (reference-main-data-types, regenerated flag list and man pages). Addresses #1651. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| auxents | ||
| bifs | ||
| cli | ||
| climain | ||
| colorizer | ||
| dkvpx | ||
| dsl | ||
| entrypoint | ||
| go-csv | ||
| input | ||
| lib | ||
| mlrval | ||
| output | ||
| parsing | ||
| pbnjay-strptime | ||
| platform | ||
| runtime | ||
| scan | ||
| stream | ||
| terminals | ||
| transformers | ||
| types | ||
| version | ||
| README.md | ||
Please see ../../README-dev.md for an overview; please see each subdirectory for details about it.