Skip to content

Commit 2d8cf12

Browse files
committed
Add version to usage output
1 parent 0b7e928 commit 2d8cf12

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ elb-2 i-b910a256
2626

2727
## Installation
2828

29-
`Jt` doesn't have any dependencies.
29+
The current version is **1.0.0**. `Jt` doesn't have any dependencies.
3030

3131
```
3232
make && sudo make install

jt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#define _GNU_SOURCE
22
#define JSMN_STRICT
33
#define JSMN_PARENT_LINKS
4+
#define JT_VERSION "1.0.0"
45

56
#include <stdarg.h>
67
#include <stdio.h>
@@ -331,8 +332,8 @@ int run(char *js, int argc, char *argv[]) {
331332
*****************************************************************************/
332333

333334
void usage(int status) {
334-
fprintf(stderr, "Usage: jt [-h] [-F <char>] [-R <char>] [COMMAND ...]\n");
335-
fprintf(stderr, "Transform JSON data into tab delimited lines of text.\n");
335+
fprintf(stderr, "jt %s - transform JSON data into tab delimited lines of text.\n", JT_VERSION);
336+
fprintf(stderr, "Usage: jt [-hjs] [-i <file>] [-o <file>] [-F <ch>] [-R <ch>] [COMMAND ...]\n");
336337
fprintf(stderr, "COMMAND is one of `[', `]', `%%', `?', `^', or a property name.");
337338
exit(status);
338339
}

0 commit comments

Comments
 (0)