patch

    patch command for MoonX.

    command-line
    moonx
    wasm
    Download zip
    Author
    Version
    0.2.2
    License
    Apache-2.0
    Last updated
    10 hours ago
    Downloads
    72

    #patch

    Apply unified and context patches for MoonX.

    moonx cli/patch@0.2.2 [OPTION]... [ORIGINALFILE [PATCHFILE]]

    #Supported scope

    Check patches with offsets, fuzz and reversal. Supports creating/deleting files and writing patched existing-file content to stdout.

    #Options

    OptionDescription
    -p, --strip=Nremove N leading file-name components
    -i, --input=FILEread the patch from FILE instead of stdin
    -o, --output=-write patched files to stdout
    -r, --reject-file=FILEwrite rejected hunks to a new FILE; - discards
    -d, --directory=DIRresolve target paths relative to DIR
    -R, --reverseapply additions as removals and vice versa
    --dry-runcheck without writing or deleting files
    -s, --quietsuppress routine file messages
    -u, --unifiedrequire unified input
    -c, --contextrequire context input
    -t, --batchselect a detected reverse without prompting
    -F, --fuzz=Nignore up to N outer context lines (default 2)
    --no-backup-if-mismatchaccept the no-backup strict profile
    --help / --versionShow help / package version.

    #Limitations

    • Updating existing pathnames and named -o output are rejected; use --dry-run or -o -.
    • Binary/mode/rename patches, backups and interactive reversal prompts are unsupported. Existing reject files are never overwritten.
    • Exit 1 for rejected hunks and 2 for malformed, unsupported or fatal requests.

    #Examples

    moonx cli/patch@0.2.2 --dry-run -i change.diff moonx cli/patch@0.2.2 -o - -i change.diff original.txt

    Change

    type Change

    FilePatch

    type FilePatch

    Hunk

    type Hunk

    Powered by MoonBit

    Site sourceReport issueModulesSkillsBuild queueStatistics

    © 2026 mooncakes.io