https://github.com/fancellu/cats-effect-decline-example
Cats effect Decline (Composable command-line parsing for Scala) example
https://github.com/fancellu/cats-effect-decline-example
cats-effect-3 decline refined
Last synced: about 2 months ago
JSON representation
Cats effect Decline (Composable command-line parsing for Scala) example
- Host: GitHub
- URL: https://github.com/fancellu/cats-effect-decline-example
- Owner: fancellu
- Created: 2022-10-27T15:44:18.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-27T15:49:03.000Z (over 3 years ago)
- Last Synced: 2025-02-25T10:33:17.251Z (over 1 year ago)
- Topics: cats-effect-3, decline, refined
- Language: Scala
- Homepage:
- Size: 1.95 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Cats effect Decline example
### Composable command-line parsing for Scala
https://ben.kirw.in/decline/
## Using in an effectful manner
Just run the below examples, replacing ```com.felstar.HelloWorld``` with ```com.felstar.HelloWorldIO```
### To run
Run it with no params
```
sbt "runMain com.felstar.HelloWorld"
```
Run it with --help param, displays the help for the app and its params
```
sbt "runMain com.felstar.HelloWorld --help"
```
Run it with --target param
```
sbt "runMain com.felstar.HelloWorld --target Dino"
```
Run it with -t short param
```
sbt "runMain com.felstar.HelloWorld -t Ralf"
```
Run it with positional params
```
sbt "runMain com.felstar.HelloWorld Dave Ralf"
```
Run it with forbidden name for positional param
```
sbt "runMain com.felstar.HelloWorld John"
```
Run it with refined number that doesn't match PosInt
```
sbt "runMain com.felstar.HelloWorld --posInt -123"
```
Run it with unparseable number
```
sbt "runMain com.felstar.HelloWorld --posInt woof"
```