Sign in

    fold

    fold command for MoonX.

    command-line
    moonx
    wasm
    Download zip
    Author
    Version
    0.1.1
    License
    Apache-2.0
    Last updated
    8 hours ago
    Downloads
    23

    Dependencies

    #fold

    Version 0.1.1 behavior is documented here. The support record separates local verification from published MoonX behavior; moonx examples use registry releases.

    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.

    #Standalone metadata

    Standalone --version prints exactly fold 0.1.1 followed by one newline. Standalone --help starts with Usage: fold, lists both metadata options, and ends with a newline. Both write to stdout, leave stdin unread, and exit with status 0. Exact-version publication and verification remain recorded separately in the support record.

    FoldState

    type FoldState

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io