Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mpclarkson/printr
ANSI formatted output for Swift CLI applications on OSX and Linux
https://github.com/mpclarkson/printr
Last synced: 26 days ago
JSON representation
ANSI formatted output for Swift CLI applications on OSX and Linux
- Host: GitHub
- URL: https://github.com/mpclarkson/printr
- Owner: mpclarkson
- License: mit
- Created: 2016-02-17T10:18:46.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-02-17T11:09:21.000Z (over 8 years ago)
- Last Synced: 2023-05-28T09:20:38.566Z (over 1 year ago)
- Language: Swift
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#Printr - ANSI Formatted Output for Swift CLI Applications
This library provides helpers to format output for CLI applications written in Swift for OSX and Linux.
###Basic Example
```swift
import Printrlet printer = Printr() //Default formatting. Alternatively init with custom formats
print.alert(.Error("Oh no, something broke"))
//prints a styled errorlet formats = [Text.Bold, Color.Red]
print.text("some formatted text", formats: formats)
//prints the string in bold, red```
###Instructions
Install this library with the Swift Package Manager
```swift
let package = Package(
name: "MyCLIApp",
dependencies: [
.Package(url: "https://github.com/mpclarkson/printr.git", majorVersion: 0)
]
)```
###Contributions
Pull requests are welcome!
You can learn how from this series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
###Todos
- [ ] Tests
###Author
Matthew Clarkson
[@matt_clarkson](https://twitter.com/matt_clarkson)
[Blog](https://mpclarkson.github.io)
[Work](https://hilenium.com)