Sign in

    fold

    fold command for MoonX.

    command-line
    moonx
    wasm
    Download zip
    Author
    Version
    0.1.0
    License
    Apache-2.0
    Last updated
    14 days ago
    Downloads
    48

    #fold

    Version 0.1.0 is a local candidate. See the support record for verification and release status.

    Wrap input lines to a chosen width:

    moonx cli/fold -w 72 notes.txt moonx cli/fold -s -w 40 notes.txt printf 'abcdef\n' | moonx cli/fold -b -w 3

    The default width is 80 columns. -w/--width selects a positive width; the traditional -WIDTH spelling is also accepted. -b/--bytes counts bytes, -c/--characters selects C-locale characters, and -s/--spaces breaks after the last available space or tab without dropping it. Long words are split when necessary. In column mode, tabs advance to the next eight-column stop, backspace moves back, and carriage return resets the column.

    Files are processed in operand order. No file, or -, reads stdin. An unterminated final line stays unterminated. Input bytes, including NUL and invalid UTF-8, are preserved. Locale-dependent Unicode display widths and multibyte character counting are outside the current C-locale profile. --help and --version are available. Errors return status 1.

    FoldState

    type FoldState

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io