Skip to content

Commit

Permalink
Col foot (#147)
Browse files Browse the repository at this point in the history
* add footer for short rows but wide columns

* remove unneded db file

* update change log

* add some readme info

* clean version

* add changelog info

* add some more changelog
  • Loading branch information
alexhallam authored Aug 6, 2022
1 parent 352527e commit e9453d0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 7 deletions.
26 changes: 23 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
1.4.6 (2022-7-23)
1.4.30 (2022-08-23)
==================

`tv` is 1 year old 🎉🥳🎉.

* **Bug** I noticed that `tv` would not print remaining columns if the number of rows was less than `n`.

Changed `if rows_remaining > 0` to `if rows_remaining > 0 || (cols - num_cols_to_print) > 0` as the
condition needed to get the footer to kick in.

Also, I was looking through the changelog and saw that I never gave credit to @burntsushi for holding
my hand as I was starting this project 1 year ago. I had a vision for this CLI, but was struggling with
some basics as I was learning Rust. Thank You!

Note: Yes, I know there are a lot of versions skipped! I was struggling with getting some automated builds for
one of the releases. One quark is that builds are triggered with git tags. I used up a lot of git tags to test
things out. Which reminds me, thanks @certifiedloud for making the most recent builds possible. I could not
have done it without you.


1.4.6 (2022-07-23)
==================

This update was mainly focused on feature enhancements. I also did some `clippy` formatting.
Expand All @@ -21,15 +41,15 @@ As requested I implemented `-R`, `--no-row-numbering` for this functionality

As requested I implemented `-D`, `--no-dimensions` for this functionality

1.4.5 (2021-5-1)
1.4.5 (2021-05-10)
==================

* **Bug 1** Though `-e` was added as an option I found that it was not overriding the `-n` argument. The fix was made with a simple if/else statement.

It may seem odd to bump the version with such a small bug, but I did not want to have something in the help file that was not functional in
the CLI.

1.4.4 (2021-5-02)
1.4.4 (2021-05-02)
==================

* **Feature 1** Added `-e` flag to extend rows (don't truncate).
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "Unlicense/MIT"
name = "tidy-viewer"
readme = "README.md"
repository = "https://github.com/alexhallam/tv"
version = "1.4.6"
version = "1.4.30"

[package.metadata.deb]
assets = [
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ For information on dotfile configuration see `tv --help`. This allows users to s
`tv --help`

```txt
tv 1.4.6
tv 1.4.30
Tidy Viewer (tv) is a csv pretty printer that uses column styling to maximize viewer enjoyment.✨✨📺✨✨
Example Usage:
Expand Down Expand Up @@ -426,6 +426,12 @@ ls -l --block-size=M # the data is farily large at 192MB
sqlite3 :memory: -csv -header -cmd '.import taxi.csv taxi' 'SELECT passenger_count, COUNT(*), AVG(total_amount) FROM taxi GROUP BY passenger_count' | tv
```

The above one-liner queries a csv as an in-memory database. It is also possible to query an *existing* `sqlite` database and pipe the output as a csv for `tv` to pick up. A one-liner is shown below.

```bash
sqlite3 -csv -header <file_name.sqlite> 'select * from <table>;' | tv
```

## Use With DuckDB

[DuckDB](https://duckdb.org/why_duckdb) has a lot in common with SQLite. As personal anecdotes I do like that fewer CLI flags are needed to run on csvs. I also like the speed. Though it is not as universal as SQLite I think that it is a good fit for command line data manipulation.
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ fn main() {
});

// additional row info
if rows_remaining > 0 {
if rows_remaining > 0 || (cols - num_cols_to_print) > 0 {
let _ = match stdout!("{: >6} ", "") {
Ok(_) => Ok(()),
Err(e) => match e.kind() {
Expand Down

0 comments on commit e9453d0

Please sign in to comment.