A collection of Scala command-line interface tools.
Humanize or dehumanize bytes:
import scalax.cli.Memory
Memory.humanize(10485760) // "10 MiB"
implicit val MU = Memory.SI
Memory.dehumanize("10 MB") // Some(10000000)
Print a pretty command line table:
// create the table builder object
import scalax.cli.Table
import shapeless.Sized
val table = Table(Sized("h1", "h2", "h3"))
table.rows += Sized("a", "b", "c")
table.rows += Sized("d", "e", "f")
table.alignments(1) = Table.Alignment.Right
// get lines
val lines: List[String] = table.lines
// print it directly
table.print()
table.print(Console.err)
// h1 | h2 | h3
// ---|----|---
// a | b | c
// d | e | f
- dehumanize un-pretty-print byte values
- highlight search for pattern and highlight matches
- humanize pretty-print byte values
- meansd print mean and standard deviation
Install all apps with the scala-cli-tools AUR package:
pacaur -S scala-cli-tools
Install all apps to ~/bin
:
PREFIX=$HOME NATIVE_MODE=release \
sbt install