]>
Commit | Line | Data |
---|---|---|
b398ee5a | 1 | #include "reverse_lib.h" |
9571ed09 | 2 | |
9571ed09 | 3 | #include <err.h> |
a99e77b4 | 4 | #include <stdio.h> |
a3915755 | 5 | #include <string.h> |
9571ed09 SW |
6 | #include <sysexits.h> |
7 | ||
9571ed09 | 8 | int main(int argc, char** argv) { |
a3915755 SW |
9 | if (argc == 1 || (argc == 2 && strcmp(argv[1], "-") == 0)) { |
10 | reverse_stream(stdin, stdout); | |
11 | } else if (argc == 2) { | |
12 | reverse_file(argv[1], stdout); | |
13 | } else { | |
9571ed09 SW |
14 | errx(EX_USAGE, "Usage: reverse filename"); |
15 | } | |
9571ed09 SW |
16 | return 0; |
17 | } |