diff options
| author | Timo Wilken | 2019-09-27 18:22:42 +0100 |
|---|---|---|
| committer | Timo Wilken | 2019-09-27 18:22:42 +0100 |
| commit | 980daeae113c44af53f11df037c42bcf94a0984c (patch) | |
| tree | 6445d5e9597496cda65b05877aea8d544ab2f1fe | |
| parent | 37d8b8630dc684386cde134bb6848660ad1f20e4 (diff) | |
| -rw-r--r-- | README.md | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..8b639b2 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# Primes utility + +This program can generate primes, check numbers for prime-ness, or filter a list +of numbers, passing only primes through. All input is on `stdin`. + +## Try it + +```{sh} +$ ghc -O2 -dynamic primes +$ ./primes 20 +``` + +## Usage + +``` +Usage: primes [--check | [--stdin] [NUM_PRIMES]] + + -h, --help print this message and exit + --check check all numbers given on stdin for primeness + --stdin reads numbers from stdin; copies primes to stdout + NUM_PRIMES only print the first NUM_PRIMES primes; + if not given, output is potentially unbounded + +If --check is given, the exit code 0 indicates all numbers were +prime; 1 indicates that at least one non-prime was passed in. +``` |
