mirror of
https://github.com/nsomar/Swiftline.git
synced 2024-09-11 05:35:42 +03:00
Updating readme and adding LICENCE
This commit is contained in:
parent
c642a4cf07
commit
315538e3f5
19
LICENCE
Normal file
19
LICENCE
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2015 Omar Abdelhafith <o.arrabi@me.com>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
16
Readme.md
16
Readme.md
@ -1,4 +1,6 @@
|
|||||||
# Swiftline
|
# Swiftline
|
||||||
|
🎨❓🏃
|
||||||
|
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/oarrabi/swiftline.svg?branch=master)](https://travis-ci.org/oarrabi/swiftline)
|
[![Build Status](https://travis-ci.org/oarrabi/swiftline.svg?branch=master)](https://travis-ci.org/oarrabi/swiftline)
|
||||||
|
|
||||||
@ -8,9 +10,9 @@ Swiftline is a set of tools to help you create command line applications. Swiftl
|
|||||||
|
|
||||||
Swiftline can be divided to three main parts:
|
Swiftline can be divided to three main parts:
|
||||||
|
|
||||||
- Colorize; Helps adding colors to strings written to the terminal
|
- Colorize 🎨; Helps adding colors to strings written to the terminal
|
||||||
- Ask, Choose and agree; Easily create prompt for asking the user more info
|
- Ask , Choose and agree ❓; Easily create prompt for asking the user more info
|
||||||
- Runner; A quick way to run an external command and read its standard output and standard error.
|
- Runner 🏃; A quick way to run an external command and read its standard output and standard error.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@ -47,7 +49,7 @@ You can compose foreground, background, and style:
|
|||||||
print("I am an underlined red on white string".s.Underline.f.Red.b.White)
|
print("I am an underlined red on white string".s.Underline.f.Red.b.White)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Ask, Choose, Agree
|
## Ask, Choose, Agree ❓
|
||||||
Ask, Choose and Agree are used to prompt the user for more information.
|
Ask, Choose and Agree are used to prompt the user for more information.
|
||||||
|
|
||||||
### Ask
|
### Ask
|
||||||
@ -182,7 +184,7 @@ If the user enters any invalid input, agree will keep prompting him for a Yes/No
|
|||||||
|
|
||||||
You entered false
|
You entered false
|
||||||
|
|
||||||
## Runner
|
## Runner 🏃
|
||||||
Runner provides a quick, concise way to run an external command and read its standard output and standard error.
|
Runner provides a quick, concise way to run an external command and read its standard output and standard error.
|
||||||
|
|
||||||
To execute a simple command you would do:
|
To execute a simple command you would do:
|
||||||
@ -225,11 +227,11 @@ Set `interactive` to true if you expect the launched command to ask input from t
|
|||||||
|
|
||||||
`runWithoutCapture("command")` is a quick way to run a command in interactive mode. The return value is the exit code of that command.
|
`runWithoutCapture("command")` is a quick way to run a command in interactive mode. The return value is the exit code of that command.
|
||||||
|
|
||||||
### Improvement
|
### Future Improvement
|
||||||
- Better documentation
|
- Better documentation
|
||||||
- Add gather (from [highline](https://github.com/JEG2/highline)) to ask function
|
- Add gather (from [highline](https://github.com/JEG2/highline)) to ask function
|
||||||
- Figure out a way to eliminate the need of `interactive`
|
- Figure out a way to eliminate the need of `interactive`
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
Tests can be found [here](). They can be normally run from the Xcode
|
Tests can be found [here](https://github.com/oarrabi/Swiftline/tree/master/SwiftlineTests). They can be normally run from the Xcode
|
||||||
.
|
.
|
||||||
|
Loading…
Reference in New Issue
Block a user