Browse Source

Print program name and version only in help screen and when -V is set.

Georgi Chorbadzhiyski 9 years ago
parent
commit
68716f6cda
2 changed files with 2 additions and 5 deletions
  1. 0
    2
      README
  2. 2
    3
      videohubctrl.c

+ 0
- 2
README View File

@@ -115,8 +115,6 @@ Here is how videohubctrl output looks like:
115 115
 
116 116
 |----------------------------------------------------------------------|
117 117
 gf@gf:~/git/videohubctrl$ ./videohubctrl --host sdi-matrix
118
-videohubctrl Version: 0.1 Git: 0.1
119
-
120 118
 Protocol version: 2.4
121 119
 Model name: Blackmagic Micro Videohub
122 120
 Unique ID: 7c2e0d021714

+ 2
- 3
videohubctrl.c View File

@@ -51,6 +51,7 @@ static const struct option long_options[] = {
51 51
 };
52 52
 
53 53
 static void show_help(struct videohub_data *data) {
54
+	printf("%s\n", program_id);
54 55
 	printf("\n");
55 56
 	printf(" Usage: " PROGRAM_NAME " --host <host> [..commands..]\n");
56 57
 	printf("\n");
@@ -149,7 +150,7 @@ static void parse_options(struct videohub_data *data, int argc, char **argv) {
149 150
 				show_help(data);
150 151
 				exit(EXIT_SUCCESS);
151 152
 			case 'V': // --version
152
-				// program_id is already printed on startup, just exit.
153
+				printf("%s\n", program_id);
153 154
 				exit(EXIT_SUCCESS);
154 155
 		}
155 156
 	}
@@ -218,8 +219,6 @@ static int read_device_command_stream(struct videohub_data *d) {
218 219
 int main(int argc, char **argv) {
219 220
 	struct videohub_data *data = &maindata;
220 221
 
221
-	printf("%s\n", program_id);
222
-
223 222
 	parse_options(data, argc, argv);
224 223
 	set_log_io_errors(0);
225 224
 

Loading…
Cancel
Save