Skip to content

Commit 6c29f02

Browse files
committed
improve the readme and example
1 parent 790ef1e commit 6c29f02

File tree

1 file changed

+40
-51
lines changed

1 file changed

+40
-51
lines changed

README.md

Lines changed: 40 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -7,59 +7,48 @@
77

88
The goal of this package is to be a dropped in replacement for the [diffutils commands](https://www.gnu.org/software/diffutils/) in Rust.
99

10-
1110
Based on the incomplete diff generator in https://github.com/rust-lang/rust/blob/master/src/tools/compiletest/src/runtest.rs, and made to be compatible with GNU's diff and patch tools.
1211

12+
13+
## Installation
14+
15+
Ensure you have Rust installed on your system. You can install Rust through [rustup](https://rustup.rs/).
16+
17+
Clone the repository and build the project using Cargo:
18+
19+
```bash
20+
git clone https://github.com/uutils/diffutils.git
21+
cd diffutils
22+
cargo build --release
1323
```
14-
~/diffutils$ cargo run -- diff -u3 Cargo.lock Cargo.toml
24+
25+
```bash
26+
27+
cat <<EOF >fruits_old.txt
28+
Apple
29+
Banana
30+
Cherry
31+
EOF
32+
33+
cat <<EOF >fruits_new.txt
34+
Apple
35+
Fig
36+
Cherry
37+
EOF
38+
39+
$ cargo run -- -u fruits_old.txt fruits_new.txt
1540
Finished dev [unoptimized + debuginfo] target(s) in 0.00s
16-
Running `target/debug/diff -u3 Cargo.lock Cargo.toml`
17-
--- Cargo.lock
18-
+++ Cargo.toml
19-
@@ -1,39 +1,7 @@
20-
-# This file is automatically @generated by Cargo.
21-
-# It is not intended for manual editing.
22-
-version = 3
23-
-
24-
-[[package]]
25-
-name = "context-diff"
26-
-version = "0.1.0"
27-
-dependencies = [
28-
- "diff 0.1.12",
29-
-]
30-
-
31-
-[[package]]
32-
-name = "diff"
33-
-version = "0.1.0"
34-
-dependencies = [
35-
- "context-diff",
36-
- "normal-diff",
37-
- "unified-diff",
38-
-]
39-
-
40-
-[[package]]
41-
-name = "diff"
42-
-version = "0.1.12"
43-
-source = "registry+https://github.com/rust-lang/crates.io-index"
44-
-checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499"
45-
-
46-
-[[package]]
47-
-name = "normal-diff"
48-
-version = "0.1.0"
49-
-dependencies = [
50-
- "diff 0.1.12",
51-
-]
52-
-
53-
-[[package]]
54-
-name = "unified-diff"
55-
-version = "0.3.0"
56-
-dependencies = [
57-
- "diff 0.1.12",
58-
+[workspace]
59-
+members = [
60-
+ "lib/unified-diff",
61-
+ "lib/context-diff",
62-
+ "lib/normal-diff",
63-
+ "bin/diff",
64-
]
41+
Running `target/debug/diffutils -u fruits_old.txt fruits_new.txt`
42+
--- fruits_old.txt
43+
+++ fruits_new.txt
44+
@@ -1,3 +1,3 @@
45+
Apple
46+
-Banana
47+
+Fig
48+
Cherry
49+
6550
```
51+
52+
## License
53+
54+
diffutils is licensed under the MIT and Apache Licenses - see the `LICENSE-MIT` or `LICENSE-APACHE` files for details

0 commit comments

Comments
 (0)