From 577fd8dca27ad6de5a768f2ef431063d196bc6e4 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Sun, 10 Sep 2023 17:56:44 -0400 Subject: [PATCH] `diff`: add examples [skip ci] --- src/cmd/diff.rs | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/cmd/diff.rs b/src/cmd/diff.rs index 501662614..b6a3cafe3 100644 --- a/src/cmd/diff.rs +++ b/src/cmd/diff.rs @@ -1,14 +1,34 @@ static USAGE: &str = r#" -Find the difference between two CSVs. +Find the difference between two CSVs with ludicrous speed. Note that diff does not support stdin. A file path is required for both arguments. +Examples: + +Find the difference between two CSVs: + qsv diff left.csv right.csv + +Find the difference between two CSVs. The right CSV has no headers: + qsv diff left.csv --no-headers-right right.csv + +Find the difference between two CSVs. The left CSV uses a tab as the delimiter: + qsv diff --delimiter-left '\t' left.csv right-tab.csv + # or ';' as the delimiter + qsv diff --delimiter-left ';' left.csv right-semicolon.csv + +Find the difference between two CSVs, but only for the first two columns: + qsv diff -k 0,1 left.csv right.csv + +Find the difference between two CSVs, but only for the first two columns and +sort the result by the first and second column: + qsv diff -k 0,1 --sort-columns 0,1 left.csv right.csv + +For more examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_diff.rs + Usage: qsv diff [options] [] [] qsv diff --help -For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_diff.rs - diff options: --no-headers-left When set, the first row will be considered as part of the left CSV to diff. (When not set, the