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
 
115
 
116
 |----------------------------------------------------------------------|
116
 |----------------------------------------------------------------------|
117
 gf@gf:~/git/videohubctrl$ ./videohubctrl --host sdi-matrix
117
 gf@gf:~/git/videohubctrl$ ./videohubctrl --host sdi-matrix
118
-videohubctrl Version: 0.1 Git: 0.1
119
-
120
 Protocol version: 2.4
118
 Protocol version: 2.4
121
 Model name: Blackmagic Micro Videohub
119
 Model name: Blackmagic Micro Videohub
122
 Unique ID: 7c2e0d021714
120
 Unique ID: 7c2e0d021714

+ 2
- 3
videohubctrl.c View File

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

Loading…
Cancel
Save