| 1 | # go-yaml |
| 2 | |
| 3 | The `go-yaml` binary is a YAML node inspection tool that provides various |
| 4 | modes for analyzing and transforming YAML data. |
| 5 | |
| 6 | Below is a summary of its capabilities: |
| 7 | |
| 8 | ## License |
| 9 | |
| 10 | The `go-yaml` project is licensed under the Apache License 2.0. |
| 11 | See the [LICENSE](LICENSE) file for more details. |
| 12 | |
| 13 | ## Features |
| 14 | |
| 15 | ### YAML Parsing and Encoding |
| 16 | - `-y` / `--yaml`: Outputs YAML in a compact format. |
| 17 | - `-Y` / `--YAML`: Outputs YAML while preserving styles and comments. |
| 18 | |
| 19 | ### JSON Conversion |
| 20 | - `-j` / `--json`: Outputs JSON in a compact format. |
| 21 | - `-J` / `--JSON`: Outputs JSON in a pretty-printed format. |
| 22 | |
| 23 | ### Token Inspection |
| 24 | - `-t` / `--token`: Outputs tokens from the YAML input. |
| 25 | - `-T` / `--TOKEN`: Outputs tokens with line information. |
| 26 | |
| 27 | ### Event Inspection |
| 28 | - `-e` / `--event`: Outputs events from the YAML input. |
| 29 | - `-E` / `--EVENT`: Outputs events with line information. |
| 30 | |
| 31 | ### Node Representation |
| 32 | - `-n` / `--node`: Outputs a detailed representation of the YAML node structure. |
| 33 | |
| 34 | ### Formatting Options |
| 35 | - `-l` / `--long`: Enables long (block) formatted output. |
| 36 | |
| 37 | ### Processing Modes |
| 38 | - `-u` / `--unmarshal`: Uses `Unmarshal` instead of `Decode` for YAML input. |
| 39 | - `-m` / `--marshal`: Uses `Marshal` instead of `Encode` for YAML output. |
| 40 | |
| 41 | ### Help and Version |
| 42 | - `-h` / `--help`: Displays help information. |
| 43 | - `--version`: Displays the version of the tool. |
| 44 | |
| 45 | ## Usage |
| 46 | The tool reads YAML data from `stdin` and processes it based on the specified |
| 47 | flags. |
| 48 | It validates flag combinations and provides error messages for incompatible |
| 49 | options. |