Skip to content

Latest commit

 

History

History
101 lines (72 loc) · 4.1 KB

File metadata and controls

101 lines (72 loc) · 4.1 KB

clean

Remove qsv-generated cache files (.idx index, stats & frequency caches) to reduce clutter & simplify data packaging. With --stale, only removes caches whose source changed or is gone. Opt-in flags also clean schema, validate & moarstats outputs.

Table of Contents | Source: src/cmd/clean.rs

Description | Examples | Usage | Clean Options | Common Options

Description

Removes qsv-generated cache files to reduce clutter and simplify data packaging.

By default, clean removes the three auto-regenerable CACHES qsv writes next to a source file:

  • .idx (index)
  • .stats.csv / .stats.weighted.csv / .stats.csv.json / .stats.csv.data.jsonl (stats cache)
  • .freq.csv.data.jsonl (frequency cache)

Only files that are VERIFIABLY generated by qsv are removed, so a user file that merely happens to be named e.g. report.stats.csv is never touched (qsv stats caches are only removed when their companion .stats.csv.json sidecar is present).

clean is, by default, a DRY-RUN: it only lists what it WOULD remove (and the bytes that would be reclaimed). Pass --force to actually delete.

User OUTPUTS from schema, validate and moarstats are NOT caches and are only removed when you ask for them explicitly with --schema / --validate / --moarstats (or --all).

Examples

Preview the caches qsv would remove from the current directory:

qsv clean

Actually remove them:

qsv clean --force

Remove only STALE or orphaned caches (source changed, or source is gone), recursively, from a specific directory:

qsv clean --stale --recursive --force ./data

Remove just the caches & outputs associated with one file:

qsv clean --all --force data.csv

For the tests, see https://github.com/dathere/qsv/blob/master/tests/test_clean.rs.

Usage

qsv clean [options] [<input>]
qsv clean --help

Clean Options

     Option      Type Description Default
 ‑‑stale  flag Only remove STALE or ORPHANED caches: a cache whose source file is newer than the cache, or whose source file no longer exists.
 ‑r,
‑‑recursive 
flag Recurse into subdirectories when is a directory.
 ‑n,
‑‑dry‑run 
flag Preview only; never delete. Wins over --force if both are given (this is also the default when neither is set).
 ‑f,
‑‑force 
flag Actually delete the files.
 ‑‑index  flag Index (.idx) caches. [default category]
 ‑‑stats  flag Stats caches. [default category]
 ‑‑frequency  flag Frequency caches. [default category]
 ‑‑schema  flag schema .schema.json / .pschema.json outputs.
 ‑‑validate  flag validate .valid / .invalid / .validation-errors.tsv outputs.
 ‑‑moarstats  flag moarstats .stats.bivariate[.joined].csv outputs.
 ‑‑all  flag Select every category above.

Common Options

     Option      Type Description Default
 ‑h,
‑‑help 
flag Display this message
 ‑q,
‑‑quiet 
flag Do not print the per-file / summary report.

Source: src/cmd/clean.rs | Table of Contents | README