Skip to content

Commit 0b2f304

Browse files
committed
add -h,--help to show the usage infos
1 parent a99d4c7 commit 0b2f304

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

midimonster.c

+5
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ static int usage(char* fn){
4040
fprintf(stderr, "\t-v,--version - show version\n");
4141
fprintf(stderr, "\t-b <backend> - override backend options (can be used multiple times)\n");
4242
fprintf(stderr, "\t-i <instance> - override instance options (can be used multiple times)\n");
43+
fprintf(stderr, "\t-h,--help - show this usage info\n");
4344
fprintf(stderr, "\nInstance/Backend options format:\n");
4445
fprintf(stderr, "<instance/backend>.<option>=<value>\n");
4546
return EXIT_FAILURE;
@@ -74,6 +75,10 @@ static int args_parse(int argc, char** argv, char** cfg_file){
7475
version();
7576
return 1;
7677
}
78+
else if(!strcmp(argv[u], "-h") || !strcmp(argv[u], "--help")){
79+
usage(argv[0]);
80+
return 1;
81+
}
7782
else if(!strcmp(argv[u], "-i")){
7883
if(!argv[u + 1]){
7984
fprintf(stderr, "Missing instance override specification\n");

0 commit comments

Comments
 (0)