Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wookietreiber/scala-cli-tools
Scala Command-Line Interface Tools
https://github.com/wookietreiber/scala-cli-tools
cli command-line command-line-interface scala scala-cli
Last synced: about 1 month ago
JSON representation
Scala Command-Line Interface Tools
- Host: GitHub
- URL: https://github.com/wookietreiber/scala-cli-tools
- Owner: wookietreiber
- License: bsd-3-clause
- Archived: true
- Created: 2017-09-17T16:56:30.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-14T14:44:17.000Z (almost 6 years ago)
- Last Synced: 2024-09-25T21:28:33.724Z (about 1 month ago)
- Topics: cli, command-line, command-line-interface, scala, scala-cli
- Language: Scala
- Homepage:
- Size: 58.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Scala CLI Tools
===============[![Build Status](https://travis-ci.com/wookietreiber/scala-cli-tools.svg?branch=master)](https://travis-ci.com/wookietreiber/scala-cli-tools)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/67d9aaafa59a414e9b808ef45abb3fb0)](https://www.codacy.com/app/wookietreiber/scala-cli-tools?utm_source=github.com&utm_medium=referral&utm_content=wookietreiber/scala-cli-tools&utm_campaign=Badge_Grade)
[![Scaladoc](https://javadoc-badge.appspot.com/com.github.wookietreiber/scala-cli-tools_2.12.svg?label=scaladoc)](https://javadoc-badge.appspot.com/com.github.wookietreiber/scala-cli-tools_2.12)A collection of Scala command-line interface tools.
Table of Contents
------------------ [Library](#library)
* [Memory](#memory)
* [Table](#table)
- [Apps](#apps)
- [Installation](#installation)
* [Arch Linux](#arch-linux)
* [Manual](#manual)Library
-------### Memory
Humanize or dehumanize bytes:
```scala
import scalax.cli.MemoryMemory.humanize(10485760) // "10 MiB"
implicit val MU = Memory.SI
Memory.dehumanize("10 MB") // Some(10000000)
```### Table
Print a pretty command line table:
```scala
// create the table builder objectimport scalax.cli.Table
import shapeless.Sizedval 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
```Apps
----- **dehumanize** un-pretty-print byte values
- **highlight** search for pattern and highlight matches
- **humanize** pretty-print byte values
- **meansd** print mean and standard deviationInstallation
------------### Arch Linux
Install all apps with the [**scala-cli-tools** AUR package](https://aur.archlinux.org/packages/scala-cli-tools/):
```bash
pacaur -S scala-cli-tools
```### Manual
Install all apps to `~/bin`:
```bash
PREFIX=$HOME NATIVE_MODE=release \
sbt install
```