playCLI


License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

fr.greweb
ArtifactId

ArtifactId

playcli_2.10
Last Version

Last Version

0.11
Release Date

Release Date

Type

Type

jar
Description

Description

playCLI
playCLI
Project URL

Project URL

http://gre.github.io/playCLI-examples
Project Organization

Project Organization

fr.greweb

Download playcli_2.10

How to add to project

<!-- https://jarcasting.com/artifacts/fr.greweb/playcli_2.10/ -->
<dependency>
    <groupId>fr.greweb</groupId>
    <artifactId>playcli_2.10</artifactId>
    <version>0.11</version>
</dependency>
// https://jarcasting.com/artifacts/fr.greweb/playcli_2.10/
implementation 'fr.greweb:playcli_2.10:0.11'
// https://jarcasting.com/artifacts/fr.greweb/playcli_2.10/
implementation ("fr.greweb:playcli_2.10:0.11")
'fr.greweb:playcli_2.10:jar:0.11'
<dependency org="fr.greweb" name="playcli_2.10" rev="0.11">
  <artifact name="playcli_2.10" type="jar" />
</dependency>
@Grapes(
@Grab(group='fr.greweb', module='playcli_2.10', version='0.11')
)
libraryDependencies += "fr.greweb" % "playcli_2.10" % "0.11"
[fr.greweb/playcli_2.10 "0.11"]

Dependencies

compile (5)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.10.0
com.typesafe.play : play-iteratees_2.10 jar 2.2.0
com.typesafe : config jar 1.0.0
ch.qos.logback : logback-core jar 1.0.9
ch.qos.logback : logback-classic jar 1.0.9

test (1)

Group / Artifact Type Version
org.specs2 : specs2_2.10 jar 1.12.3

Project Modules

There are no modules declared in this project.

Play CLI

Play CLI defines helpers to deal with UNIX command with Play Framework iteratees.

Getting Started

Add this SBT dependency:

"fr.greweb" %% "playcli" % "0.12"

Play CLI depends only on play-iteratee.

Some random examples:

import playcli._
val logs = CLI.enumerate("tail -f aLogFile")
/* Ok.stream(logs) */

val colorQuantize = CLI.pipe("convert - -colors 14 png:-")
/* Ok.stream(anImageEnum &> colorQuantize) */

val scaleVideoHalf = CLI.pipe("ffmpeg -i pipe:0 -vf scale=iw/2:-1 -f avi pipe:1")
/* Ok.stream(streamEnum &> scaleVideoHalf) */

// Don't concatenate CMD string, but use the Seq syntax:
val logs = CLI.enumerate(Seq("tail", "-f", myFilePath))
/* Ok.stream(logs) */

// A consume example
val events : Enumerator[String] = …
events &> 
  Enumerator.map(e => (e+"\n").map(_.toByte).toArray) |>>> 
  CLI.consume("externalLoggerCmd")

// 

… continue to the scala API

Versions

Version
0.11
0.1