Skip to content

Commit 5b26c0a

Browse files
authored
Merge pull request #229 from dbcli/amjith/add-output
Add .output as an alias to tee to match sqlite3.
2 parents c726e9e + 500ef9f commit 5b26c0a

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Features
44

55
* Replace sqlite3 library with [sqlean](https://antonz.org/sqlean/). It's a drop-in replacement for sqlite3.
6+
* Add support for `.output` to write the results to a file.
67

78
### Bug Fixes
89

litecli/packages/special/iocommands.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,10 @@ def parseargfile(arg):
334334

335335

336336
@special_command(
337-
"tee",
338-
"tee [-o] filename",
337+
".output",
338+
".output [-o] filename",
339339
"Append all results to an output file (overwrite using -o).",
340+
aliases=("tee",),
340341
)
341342
def set_tee(arg, **_):
342343
global tee_file
@@ -408,7 +409,12 @@ def unset_once_if_written():
408409
once_file = written_to_once_file = None
409410

410411

411-
@special_command("\\pipe_once", "\\| command", "Send next result to a subprocess.", aliases=("\\|",))
412+
@special_command(
413+
"\\pipe_once",
414+
"\\| command",
415+
"Send next result to a subprocess.",
416+
aliases=("\\|",),
417+
)
412418
def set_pipe_once(arg, **_):
413419
global pipe_once_process, written_to_pipe_once_process
414420
pipe_once_cmd = shlex.split(arg)

0 commit comments

Comments
 (0)