wc

    wc command for MoonX.

    command-line
    moonx
    wasm
    Download zip
    Author
    Version
    0.2.6
    License
    Apache-2.0
    Last updated
    2 hours ago
    Downloads
    128

    #wc

    Development candidate: cli/wc@0.2.6. Publication is separate; latest.json records the uploaded coordinates.

    Count input records and bytes for MoonX.

    moonx cli/wc@0.2.6 [-lwcmL] [--files0-from=FILE] [--total=WHEN] [FILE...]

    #Supported scope

    Read files or stdin and count lines, words and bytes by default. Supports selected counters and aggregate totals.

    #Options

    OptionDescription
    -l, --linesCount newline bytes.
    -w, --wordsCount C-byte words.
    -c, --bytes / -m, --charsCount bytes; both are identical in this profile.
    -L, --max-line-lengthReport maximum C-profile display width.
    --files0-from=FILERead NUL-delimited filenames; - selects stdin.
    --total=WHENSelect auto (default), always, never or only.
    --help / --versionShow help / package version.

    #Argument and exit-status contract

    Ordinary option/operand errors exit 1; documented capability refusals retain their own status.

    #Limitations

    • Unicode character counting and other locale profiles are unsupported.
    • --files0-from cannot be combined with positional files.
    • Multi-counter stdin output uses a minimum field width of seven, including regular-file redirection. GNU may derive a smaller width from the input descriptor's physical file size, so exact regular-stdin column alignment is not supported. The released moonbitlang/async@0.22.5 API exposes Input::fd, but no public query for that borrowed descriptor's kind and size. Lifting this limitation requires a released public metadata API that neither consumes, reopens nor closes stdin, followed by regular-file, pipe, empty-input and pre-positioned input validation. Named-file widths already use public size metadata.

    #Examples

    moonx cli/wc@0.2.6 -l notes.txt printf 'one two\nthree\n' | moonx cli/wc@0.2.6

    Source Files