jtbl icon indicating copy to clipboard operation
jtbl copied to clipboard

Add option --sort/--order

Open don-rumata opened this issue 6 months ago • 3 comments

Hi. Can you add an option to sort columns in a table?

Now:

curl --silent http://<my-repo-in-intranet>/apt/debian/dists/stable/main/binary-amd64/Packages | /usr/local/bin/jc --pkg-index-deb -p | /usr/local/bin/jp "sort_by([], &package)[].{package: package, version: version, homepage: homepage}"  | /usr/local/bin/jtbl --markdown
| homepage                                       | package      | version    |
|------------------------------------------------|--------------|------------|
| https://schollz.com/software/croc/             | croc         | 9.6.6      |
| https://github.com/jgraph/drawio               | draw.io      | 22.1.2     |
|                                                | ifcplugin    | 3.1.1.0    |
| https://github.com/kellyjonbrazil/jc           | jc           | 1.24.0-1   |
| https://github.com/kellyjonbrazil/jtbl         | jtbl         | 1.6.0-1    |
|                                                | naps2        | 7.2.1      |
|                                                | pandoc       | 3.1.11-1   |
| https://rclone.org                             | rclone       | 1.65.0     |
|                                                | scenebuilder | 21.0.0     |
| https://github.com/ansible-semaphore/semaphore | semaphore    | 2.9.37     |
| www.hamrick.com                                | vuescan      | 9.8.22.0-0 |

How i want:

jtbl --markdown --order=package,version,homepage
| package       | version       | homepage                                       |
|---------------|---------------|------------------------------------------------|
| croc          | 9.6.6         | https://schollz.com/software/croc/             |
| draw.io       | 22.1.2        | https://github.com/jgraph/drawio               |
| ifcplugin     | 3.1.1.0       |                                                |
| jc            | 1.24.0-1      | https://github.com/kellyjonbrazil/jc           |
| jtbl          | 1.6.0-1       | https://github.com/kellyjonbrazil/jtbl         |
| naps2         | 7.2.1         |                                                |
| pandoc        | 3.1.11-1      |                                                |
| rclone        | 1.65.0        | https://rclone.org                             |
| scenebuilder  | 21.0.0        |                                                |
| semaphore     | 2.9.37        | https://github.com/ansible-semaphore/semaphore |
| vuescan       | 9.8.22.0-0    | www.hamrick.com                                |

don-rumata avatar Dec 18 '23 22:12 don-rumata