From 71c7f6ca0ab109148f0ce7b7bf1db137bdaf3b2d Mon Sep 17 00:00:00 2001 From: Stefan Karpinski Date: Thu, 18 Jun 2020 09:59:25 -0400 Subject: [PATCH] README: add usage example --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 18d120e..b06c163 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,30 @@ different new files. +## Usage Example + +```julia +julia> cd(mktempdir()) + +julia> open("goodbye.txt", write=true) do io + println(io, "Goodbye, world.") + end + +julia> open("hello.txt", write=true) do io + println(io, "Hello, world!") + end + +julia> using BSDiff + +julia> patch = bsdiff("goodbye.txt", "hello.txt"); + +julia> bspatch("goodbye.txt", "hello_copy.txt", patch) +"hello_copy.txt" + +julia> read(ans, String) +"Hello, world!\n" +``` + ## Reproducibility Even though this package produces patch files that are compatible with the