quicli
quicli copied to clipboard
Add output helpers?
What is a typical thing in a CLI app where you need to output stuff? What can we add to quicli that would make outputting information/data to the terminal really convenient?
E.g. https://docs.rs/indicatif and https://docs.rs/prettytable-rs
https://docs.rs/termstyle/0.1.1/termstyle/
this is my crate
Quoting @polarathene from #22:
How would you go about introducing progress visuals(common to see something like
[=====---------]49%
) or busy indicators(I've seen a project for this, maybe it was in zsh but should be portable to general CLI output from Rust).I recall using a CLI app, Hashcat last year that would show several lines of what was going on followed by many lines of status of the computation that was updated and below that were some interactivity options along with shortcut keys that could pause/stop/save/etc the computation.
I guess these would both be a better story as async support develops further in the year, but a neat feature for quicli to be able to offer easily setting up? Item (key, description/label, function to call), view(list of items arranged horizontally I guess?)... or is that going too far into TUI land?
You should also consider supporting coloured output, which is a thing with CLI apps. Perhaps using something like: https://docs.rs/console/0.6.1/console/
console makes sense to use when we are also using indicatif, as it is one of its dependencies anyway. Not sure if it supports Windows (or if we should care about that right now)
There are a LOT of different crates here and the ecosystem has far from stabilized IMO. I think it would be a mistake to include a specific library in quicli
.
Some possible libraries:
-
ansi_term
-
console
-
termstyle
-
prettytable-rs
-
crossterm
I think this is a field where we actually need a conglomeration crate that combines other crates into a unified, testable API. That is what I hope termstyle
to become but it is far from that point.