You can run the program with the command
./gradlew run --args="[OPTIONS] FILES"
For example ./gradlew run --args="-q files/text1.txt files/text2.txt"
All options should start with at least one '-', otherwise it's the name of the file.
If you don't write any file names, it would be "/src/text1.txt" and "/src/text2.txt" by default.
Compare FILES line by line.
Sometimes my diff program returns not the same as the diff utility, because they find different LCS.
I'm totally recommend you to use the utility with option --unified
The standard output for diff command in bash.
A char between two segments representing the operation.
- "a" to Add/Insert operation
- "c" to Change operation
- "d" to Delete/Remove operation
The segments represent the number of lines in the first file and in the second file respectively.
-q, --brief, report only when files differ-s, --report-identical-filesreport when two files are the same-i, --ignore-caseignore case differences in file contents--unidirectional-newtreat absent first files as empty-c, --no-coloroutput diff result with no color-u[=N], -U[=N], --unified[=N]output NUM (default 3) lines of unified context--no-infodo not output path of files and timestamp(only with option--unified)
You can change default value of options in file settings
If multiplication of number of lines of files are huge my program crushes because of
"Exception in thread "main" java.lang.OutOfMemoryError: Java heap space"
But the count of line in each file equals to 10^4 is still working. But with count of 5 * 10^4 it doesn't work.
There is some testcases here for some functions.
And there is some testcases here to check the whole program.