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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.
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!
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.
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)