quicli icon indicating copy to clipboard operation
quicli copied to clipboard

Add output helpers?

Open killercup opened this issue 7 years ago • 5 comments

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

killercup avatar Jan 21 '18 23:01 killercup

https://docs.rs/termstyle/0.1.1/termstyle/

this is my crate

vitiral avatar Jan 22 '18 18:01 vitiral

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?

killercup avatar Jan 26 '18 10:01 killercup

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/

mattgathu avatar Jan 31 '18 06:01 mattgathu

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)

killercup avatar Jan 31 '18 08:01 killercup

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.

vitiral avatar Feb 06 '18 16:02 vitiral