effect


License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

com.monovore
ArtifactId

ArtifactId

decline-effect_sjs0.6_2.12
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

effect
effect
Project URL

Project URL

http://monovore.com/decline
Project Organization

Project Organization

com.monovore
Source Code Management

Source Code Management

https://github.com/bkirwi/decline

Download decline-effect_sjs0.6_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/com.monovore/decline-effect_sjs0.6_2.12/ -->
<dependency>
    <groupId>com.monovore</groupId>
    <artifactId>decline-effect_sjs0.6_2.12</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.monovore/decline-effect_sjs0.6_2.12/
implementation 'com.monovore:decline-effect_sjs0.6_2.12:1.2.0'
// https://jarcasting.com/artifacts/com.monovore/decline-effect_sjs0.6_2.12/
implementation ("com.monovore:decline-effect_sjs0.6_2.12:1.2.0")
'com.monovore:decline-effect_sjs0.6_2.12:jar:1.2.0'
<dependency org="com.monovore" name="decline-effect_sjs0.6_2.12" rev="1.2.0">
  <artifact name="decline-effect_sjs0.6_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.monovore', module='decline-effect_sjs0.6_2.12', version='1.2.0')
)
libraryDependencies += "com.monovore" % "decline-effect_sjs0.6_2.12" % "1.2.0"
[com.monovore/decline-effect_sjs0.6_2.12 "1.2.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.8
com.monovore : decline_sjs0.6_2.12 jar 1.2.0
org.scala-js : scalajs-library_2.12 jar 0.6.31
org.typelevel : cats-effect_sjs0.6_2.12 jar 2.0.0

test (1)

Group / Artifact Type Version
org.scala-js : scalajs-test-bridge_2.12 jar 0.6.31

Project Modules

There are no modules declared in this project.

decline

Build Status

A composable command-line parser, inspired by optparse-applicative and built on cats.

import cats.implicits._
import com.monovore.decline._

object HelloWorld extends CommandApp(
  name = "hello-world",
  header = "Says hello!",
  main = {
    val userOpt =
      Opts.option[String]("target", help = "Person to greet.")
        .withDefault("world")

    val quietOpt = Opts.flag("quiet", help = "Whether to be quiet.").orFalse

    (userOpt, quietOpt).mapN { (user, quiet) => 

      if (quiet) println("...")
      else println(s"Hello $user!")
    }
  }
)

To get started, please visit monovore.com/decline!

About the Project

decline is a Typelevel Incubator project, and follows the Scala Code of Conduct.

This project is released under the Apache License 2.0.

Versions

Version
1.2.0
1.0.0
0.7.0-M0