split

    split command for MoonX.

    command-line
    moonx
    wasm
    Download zip
    Author
    Version
    0.1.11
    License
    Apache-2.0
    Last updated
    4 days ago
    Downloads
    173

    #split

    Published: cli/split@0.1.11, using cli/core@0.9.5. Three-platform exact-coordinate acceptance and earlier release evidence are recorded in the changelog.

    Split input into pieces for MoonX.

    moonx cli/split@0.1.11 [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. On POSIX, every file predicate and both timestamp-comparison operands require a trailing slash to name a directory. Directory links ending in a slash select their directory, so -L/-h are false; unsuffixed links retain their ordinary behavior.

    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.11 -l 100 input.txt part- moonx cli/split@0.1.11 -b 64K -d input.bin chunk-