Context
--output result.json still writes CSV unless -O json is also passed. Input files already auto-detect format by extension (data.parquet, data.yaml — no -I needed); output should behave symmetrically.
Proposed behavior
sql-pipe data.csv -O json --output result.json 'SELECT * FROM t' # today: both flags required
sql-pipe data.csv --output result.json 'SELECT * FROM t' # proposed: .json implies -O json
- When
--output <file> is set and -O/--output-format is not, infer the format from the extension: .csv .tsv .json .ndjson .xml .md .html .sql.
- Explicit
-O always wins over the extension.
- Unknown or missing extension → current default (csv), no error.
Excluded (YAGNI)
- Inferring format for stdout (no filename — keep csv default)
- Warning when extension and
-O disagree (explicit flag wins, silently)
Acceptance criteria
Context
--output result.jsonstill writes CSV unless-O jsonis also passed. Input files already auto-detect format by extension (data.parquet,data.yaml— no-Ineeded); output should behave symmetrically.Proposed behavior
--output <file>is set and-O/--output-formatis not, infer the format from the extension:.csv .tsv .json .ndjson .xml .md .html .sql.-Oalways wins over the extension.Excluded (YAGNI)
-Odisagree (explicit flag wins, silently)Acceptance criteria
--output r.jsonwrites JSON without-O-O tsv --output r.jsonwrites TSV (flag wins)--output r.txtfalls back to csv--outputmentions the inference