wireapp/Corazza

Name: Corazza

Owner: Wire Swiss GmbH

Description: A Swift command line interaction library to ask questions and parse answers from stdin

Forked from: marcoconti83/Corazza

Created: 2016-09-12 12:30:45.0

Updated: 2017-10-07 16:31:49.0

Pushed: 2018-04-12 13:36:21.0

Homepage: null

Size: 17

Language: Swift

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Corazza

Corazza is a library to create interactive Swift scripts or command line tools. It enables to ask questions on standard output and read answers from standard input.

A simple example Swift script usage can be found in the Example folder.

Examples

Asks which kind of turtles is your favourite:

ou like turtles?
s or [N]o? (default: Y) > y

h one is your favourite?
--------------------------------
    Chelonoidis nigra
    Dermochelys coriacea
    Chelydra serpentina
    Trachemys scripta elegans
--------------------------------
se an option > 2

ve Dermochelys coriacea!
How to use Corazza in your script

Just add `import Corazza` to your script

In order to be able to import it, you need to have the Corazza in the Swift search path. You can achieve this by compiling it yourself or downloading a binary version from a release. You need to invoke Swift with the -F argument, pointing to the folder where Corazza is stored.

Carthage integration

Corazza can be downloaded locally with Carthage.

Just add

our `Cartfile`. After running

you would be able to run any swift file with

`-F` flag can also be included in the [shebang](https://en.wikipedia.org/wiki/Shebang_%28Unix%29) line of the script, so that you can just invoke the script directly (e.g. ```$> do.swift```). This is the approach used in the [examples](https://github.com/marcoconti83/corazza/tree/master/Examples) included with this project.

Without Carthage
can download the framework binary from the GitHub [latest release](https://github.com/marcoconti83/Corazza/releases/latest)

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.