summaryrefslogtreecommitdiff
path: root/src/util/pacsort.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/pacsort.c')
-rw-r--r--src/util/pacsort.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/util/pacsort.c b/src/util/pacsort.c
index 948b03d3..2d53a1cc 100644
--- a/src/util/pacsort.c
+++ b/src/util/pacsort.c
@@ -45,6 +45,7 @@ static struct options_t {
int sortkey;
int null;
int filemode;
+ int help;
char delim;
} opts;
@@ -374,7 +375,8 @@ static int parse_options(int argc, char **argv)
opts.filemode = 1;
break;
case 'h':
- return 1;
+ opts.help = 1;
+ return 0;
case 'k':
opts.sortkey = (int)strtol(optarg, NULL, 10);
if(opts.sortkey <= 0) {
@@ -420,6 +422,11 @@ int main(int argc, char *argv[])
return 2;
}
+ if(opts.help) {
+ usage();
+ return 0;
+ }
+
list = list_new(100);
buffer = buffer_new(BUFSIZ * 3);