contextual

simple and typesafe interpolated strings, checked at compile-time

Package Information

SBT

"com.propensive" %% "contextual-examples" % "1.0.0"

License

Apache 2.0

Source code

Defined contexts

Predefined substitution types

None

Shell commands (sh"")

Features

  • Parses shell commands into parameters
  • Honors single- and double-quotes, and whitespace rules
  • Allows embedding of parameters

Examples

> import contextual.examples.sh._
> sh"""grep -r 'Hello World' ."""
res: Process = Process("grep", "-r", "Hello World")
> import contextual.examples.sh._
> sh"""wc -l $file"""
res: Process = Process("wc", "-l", file)
> import contextual.examples.sh._
> sh"""git commit --message='Automated: $msg'"""
res: Process = Process("git", "commit", s"--message=Automated $msg")