Skip to content

Commit b2fc2c3

Browse files
committed
Slight reformatting
Signed-off-by: Euan Torano <[email protected]>
1 parent f083b59 commit b2fc2c3

File tree

9 files changed

+1411
-62
lines changed

9 files changed

+1411
-62
lines changed

.gitignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
nimcache/
2-
*.html
3-
tests/main
1+
nimcache
2+
tests/*
3+
!tests/*.nim
4+
!tests/nim.cfg
5+
src/*
6+
!src/*.nim
7+
nimsuggest.log
8+
.vscode

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
# Copied from https://github.com/nim-lang/Nim/wiki/TravisCI
42
language: c
53
env:
@@ -39,9 +37,7 @@ install:
3937
before_script:
4038
- export PATH="nim-$BRANCH/bin${PATH:+:$PATH}"
4139
script:
42-
- nim c --cc:$CC --verbosity:0 -r pledge.nim
43-
# Optional: build docs.
44-
- nim doc2 --docSeeSrcUrl:https://github.com/euantorano/pledge.nim/blob/master --project pledge.nim
40+
- nim c --cc:$CC --verbosity:0 -r tests/main.nim
4541
cache:
4642
directories:
4743
- nim-master

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
# pledge.nim
1+
# pledge.nim [![Travis CI Status](https://travis-ci.org/euantorano/pledge.nim.svg?branch=master)](https://travis-ci.org/euantorano/pledge.nim)
22

33
A wrapper around OpenBSD's pledge(2) systemcall for Nim.
44

55
## Installation
66

7-
This package can be installed using `nimble`:
7+
`pledge` can be installed using Nimble:
88

99
```
1010
nimble install pledge
1111
```
1212

13+
Or add the following to your `.nimble` file:
14+
15+
```
16+
# Dependencies
17+
18+
requires "pledge >= 1.1.0"
19+
```
20+
1321
## Usage
1422

1523
```nim
1624
import pledge
1725
18-
if not pledge(Promises.Stdio):
19-
# Pledge failed, cannot use stdio
20-
quit(QuitFailure)
26+
pledge(Promises.Stdio)
2127
22-
# As we haven't used pledge to ask to access files, the below will cause the program to be temrinated.
28+
# As we haven't used pledge to ask to access files, the below will cause the program to be temrinated with a SIGABRT.
2329
let f = open("/etc/rc.conf")
2430
```

0 commit comments

Comments
 (0)