diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-01-02 21:26:36 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-01-02 21:26:36 +0100 |
commit | 4b94c5bf811ef1c35f26b69ecc558a9e1c0d9d26 (patch) | |
tree | 15ff6b4b6110088c0c36e0db87367a69fb226283 | |
parent | 86993965de423bdd9f4cfb146929a1cdd9fbc0b2 (diff) |
sfeed: add -v flag to display program version
-rw-r--r-- | sfeed.1 | 8 | ||||
-rw-r--r-- | sfeed.c | 7 |
2 files changed, 12 insertions, 3 deletions
@@ -5,12 +5,16 @@ .Nm sfeed .Nd simple RSS and Atom parser .Sh SYNOPSIS -.Nm sfeed -.Op Ar suffix string +.Nm +.Op Ar suffix string | Fl Ar v .Sh DESCRIPTION .Nm reads RSS or Atom feed data (XML) from stdin. It writes the feed data in a tab-separated format to stdout. +.Sh OPTIONS +.Bl -tag -width 17n +.It Fl v +show program version .Sh TAB-SEPARATED FORMAT FIELDS .Pp The items are saved in a TSV-like format except newlines, tabs and @@ -727,8 +727,13 @@ xml_handler_end_element(XMLParser *p, const char *name, size_t namelen, int issh int main(int argc, char *argv[]) { - if(argc > 1) + if(argc > 1) { append = argv[1]; + if(!strcmp(argv[1], "-v")) { + printf("%s\n", VERSION); + return 0; + } + } /* init strings and initial memory pool size */ string_buffer_init(&ctx.item.timestamp, 64); |