Skip to content

Commit

Permalink
link to test as examples from usage text
Browse files Browse the repository at this point in the history
as much as possible.  Some tests though are a bit complicated, and may only confuse the user further, so not linking for those commands (stats, fixlengths, slice, select)
  • Loading branch information
jqnatividad committed Nov 22, 2022
1 parent db5a68b commit a0e15cd
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/cmd/dedup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Either way, the output will not only be deduplicated, it will also be sorted.
A duplicate count will also be sent to <stderr>.
For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_dedup.rs.
Usage:
qsv dedup [options] [<input>]
qsv dedup --help
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/exclude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ separating them with a comma. Specify a range of columns with `-`. Both
columns1 and columns2 must specify exactly the same number of columns.
(See 'qsv select --help' for the full syntax.)
For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_exclude.rs.
Usage:
qsv exclude [options] <columns1> <input1> <columns2> <input2>
qsv exclude --help
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/fill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ CSV is not sorted by the `--groupby` columns, rows may be
re-ordered during output due to the buffering of rows
collected before the first valid value.
For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_fill.rs.
Usage:
qsv fill [options] [--] <selection> [<input>]
qsv fill --help
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/flatten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ can be changed with the --separator flag.
There is also a condensed view (-c or --condense) that will shorten the
contents of each field to provide a summary view.
For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_flatten.rs.
Usage:
qsv flatten [options] [<input>]
qsv flatten --help
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ pipe multiple qsv commands together. However, you may want the final result to
have a specific delimiter or record separator, and this is where 'qsv fmt' is
useful.
For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_fmt.rs.
Usage:
qsv fmt [options] [<input>]
qsv fmt --help
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/frequency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ respectively.
Since this computes an exact frequency table, memory proportional to the
cardinality of each column is required.
For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_frequency.rs.
Usage:
qsv frequency [options] [<input>]
qsv frequency --help
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ CSV data.
Note that multiple CSV files may be given to this command. This is useful with
the --intersect flag.
For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_headers.rs.
Usage:
qsv headers [options] [<input>...]
qsv headers --help
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ invalid UTF-8 sequences with �.
This command is typically used in the beginning of a data pipeline to normalize & prepare CSVs
for further processing with other qsv commands.
For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_input.rs.
Usage:
qsv input [options] [<input>]
qsv input --help
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/jsonl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ fields from the input.
Also, it will fail if the JSON documents are not consistent with one another,
as the first JSON line will be use to infer the headers of the CSV output.
For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_jsonl.rs.
Usage:
qsv jsonl [options] [<input>]
qsv jsonl --help
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/partition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Partitions the given CSV data into chunks based on the value of a column
The files are written to the output directory with filenames based on the
values in the partition column and the `--filename` flag.
For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_partition.rs.
Usage:
qsv partition [options] <column> <outdir> [<input>]
qsv partition --help
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/pseudo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ static USAGE: &str = r#"
Pseudonymise the value of the given column by replacing them by an
incremental identifier.
For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_pseudo.rs.
Usage:
qsv pseudo [options] <column> [<input>]
qsv pseudo --help
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Some usage examples:
With "py map", if a python expression is invalid, "<ERROR>" is returned.
With "py filter", if a python expression is invalid, no filtering is done.
For more extensive examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_py.rs.
For more extensive examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_py.rs.
Usage:
qsv py map [options] -n <script> [<input>]
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ all of the headers, and separate them by a comma.
Use column names that contains commas and conflict with the separator:
$ qsv rename '"Date - Opening","Date - Actual Closing"'
For more examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_rename.rs.
Usage:
qsv rename [options] [--] <headers> [<input>]
qsv rename --help
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/safenames.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Returns exitcode 1 when no headers are modified.
Change the name of the columns:
$ qsv safenames data.csv
For more examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_safenames.rs.
Usage:
qsv safenames [options] [<input>]
qsv safenames --help
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ once, which is necessary to provide a uniform random sample. If you wish to
limit the number of records visited, use the 'qsv slice' command to pipe into
'qsv sample'.
For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_sample.rs.
Usage:
qsv sample [options] <sample-size> [<input>]
qsv sample --help
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ a `stdin.csv` file will created with stdin's contents as well.
Note that `stdin.csv` will be overwritten if it already exists.
For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_schema.rs.
Usage:
qsv schema [options] [<input>]
qsv schema --help
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/sniff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ to adjust).
If you want more robust, guaranteed schemata, use the "schema" or "stats" commands
instead as they scan the entire file.
For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_sniff.rs.
Usage:
qsv sniff [options] [<input>]
qsv sniff --help
Expand Down
4 changes: 3 additions & 1 deletion src/cmd/tojsonl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ static USAGE: &str = r#"
Smartly converts CSV to a newline-delimited JSON (JSONL/NDJSON).
By scanning the CSV first, it "smartly" infers the appropriate JSON data type
for each column.
for each column.
For examples, see https://github.com/jqnatividad/qsv/blob/master/tests/test_tojsonl.rs.
Usage:
qsv tojsonl [options] [<input>]
Expand Down

0 comments on commit a0e15cd

Please sign in to comment.