Browse Source

Add -V and --version parameters.

Georgi Chorbadzhiyski 13 years ago
parent
commit
679c420862
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      tsdecrypt.c

+ 7
- 1
tsdecrypt.c View File

83
 
83
 
84
 	{ "debug",				required_argument, NULL, 'D' },
84
 	{ "debug",				required_argument, NULL, 'D' },
85
 	{ "help",				no_argument,       NULL, 'h' },
85
 	{ "help",				no_argument,       NULL, 'h' },
86
+	{ "version",			no_argument,       NULL, 'V' },
86
 
87
 
87
 	{ 0, 0, 0, 0 }
88
 	{ 0, 0, 0, 0 }
88
 };
89
 };
157
 	printf("                            .    3 = show duplicate ECMs\n");
158
 	printf("                            .    3 = show duplicate ECMs\n");
158
 	printf("                            .    4 = packet debug\n");
159
 	printf("                            .    4 = packet debug\n");
159
 	printf(" -h --help                  | Show help screen.\n");
160
 	printf(" -h --help                  | Show help screen.\n");
161
+	printf(" -V --version               | Show program version.\n");
160
 	printf("\n");
162
 	printf("\n");
161
 }
163
 }
162
 
164
 
185
 
187
 
186
 static void parse_options(struct ts *ts, int argc, char **argv) {
188
 static void parse_options(struct ts *ts, int argc, char **argv) {
187
 	int j, i, ca_err = 0, server_err = 1, input_addr_err = 0, output_addr_err = 0, output_intf_err = 0, ident_err = 0;
189
 	int j, i, ca_err = 0, server_err = 1, input_addr_err = 0, output_addr_err = 0, output_intf_err = 0, ident_err = 0;
188
-	while ( (j = getopt_long(argc, argv, "i:d:l:L:I:RzO:o:t:pc:C:s:U:P:y:eZ:Ef:X:G:KJ:D:h", long_options, NULL)) != -1 ) {
190
+	while ( (j = getopt_long(argc, argv, "i:d:l:L:I:RzO:o:t:pc:C:s:U:P:y:eZ:Ef:X:G:KJ:D:hV", long_options, NULL)) != -1 ) {
189
 		char *p = NULL;
191
 		char *p = NULL;
190
 		switch (j) {
192
 		switch (j) {
191
 			case 'i':
193
 			case 'i':
325
 			case 'h':
327
 			case 'h':
326
 				show_help(ts);
328
 				show_help(ts);
327
 				exit(0);
329
 				exit(0);
330
+
331
+			case 'V':
332
+				printf("%s\n", program_id);
333
+				exit(0);
328
 		}
334
 		}
329
 	}
335
 	}
330
 	if (ts->syslog_active && !ts->ident[0])
336
 	if (ts->syslog_active && !ts->ident[0])

Loading…
Cancel
Save