split

    split command for MoonX.

    command-line
    moonx
    wasm
    Download zip
    Author
    Version
    0.1.9
    License
    Apache-2.0
    Last updated
    16 days ago
    Downloads
    259

    #split

    Development candidate: cli/split@0.1.9, using cli/core@0.9.4. Publication is pending. Earlier exact-coordinate acceptance is recorded in the changelog.

    Split input into pieces for MoonX.

    moonx cli/split@0.1.9 [OPTION]... [FILE [PREFIX]]

    #Supported scope

    Split files or stdin by records, bytes, bounded line bytes or N-way partitions. Default is 1000 records per piece with names xaa, xab, etc.

    Filter test -s follows final targets and queries metadata without opening them. Missing/cyclic targets are false; unavailable sizes such as macOS directories produce explicit shell errors. Filters retain responsibility for handling errors and for their explicit output files.

    Filter sessions inherit the shared shell's arithmetic assignments, backticks, expanded here-documents, standard stream aliases, loop control and finite printf/test profile. See sh for grammar and API boundaries.

    #Options

    OptionDescription
    -l, --lines=NUMBERput NUMBER records in each piece (default 1000)
    -b, --bytes=SIZEput SIZE bytes in each piece
    -C, --line-bytes=SIZEput at most SIZE bytes of records in each piece
    -n, --number=CHUNKSN, K/N, l/N, l/K/N, r/N or r/K/N
    -a, --suffix-length=Nfixed suffix width; zero selects automatic width
    -d, --numeric-suffixes[=FROM]numeric suffixes
    -x, --hex-suffixes[=FROM]hexadecimal suffixes
    --additional-suffix=SUFFIXappend SUFFIX to generated names
    -e, --elide-empty-filesomit empty outputs
    --filter=COMMANDrun pure shell source per piece with FILE set
    --help / --versionShow help / package version.

    #Argument and exit-status contract

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

    #Limitations

    • Existing named outputs are refused; failures retain completed pieces.
    • --filter uses the supported sh subset and cannot combine with selected K/N stdout output. Round-robin filters can run concurrently.
    • Some modes require writable temporary storage.

    #Examples

    Filter syntax errors, including unmatched reserved words and empty required compound lists, fail before that command list writes files. The filter's actual status propagates and its owned input/task is closed by the existing lifecycle. A complete filter ending in backslash-LF executes at EOF; genuinely unfinished syntax still fails.

    moonx cli/split@0.1.9 -l 100 input.txt part- moonx cli/split@0.1.9 -b 64K -d input.bin chunk-