unexpand
Convert leading spaces into tab characters to compress indentation. Accepts files or stdin, read-only, returns JSON by default.
Instructions
Convert leading spaces to tab characters in files or stdin. Read-only, no side effects (does not modify files). Returns JSON by default; use --raw for plain output. Use to compress indentation for storage. Not for tabs to spaces — use 'expand' for the reverse operation. See also 'expand'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Convert all blank runs, not only leading spaces. | |
| encoding | No | Text encoding. | utf-8 |
| max_lines | No | Maximum JSON lines to emit. | |
| paths | No | Files to read, or '-' for stdin. Defaults to stdin. | |
| raw | No | Write unexpanded text without a JSON envelope. | |
| tabs | No | Tab stop width. |