|
@@ -29,6 +29,7 @@ int quiet;
|
29
|
29
|
static struct videohub_data maindata;
|
30
|
30
|
static int show_info = 1;
|
31
|
31
|
static int show_monitor = 0;
|
|
32
|
+static int show_backup = 0;
|
32
|
33
|
static int show_list = 0;
|
33
|
34
|
|
34
|
35
|
enum list_actions {
|
|
@@ -39,7 +40,7 @@ enum list_actions {
|
39
|
40
|
|
40
|
41
|
static const char *program_id = PROGRAM_NAME " Version: " VERSION " Git: " GIT_VER;
|
41
|
42
|
|
42
|
|
-static const char short_options[] = "h:p:qdHVim";
|
|
43
|
+static const char short_options[] = "h:p:qdHVimb";
|
43
|
44
|
|
44
|
45
|
static const struct option long_options[] = {
|
45
|
46
|
{ "host", required_argument, NULL, 'h' },
|
|
@@ -50,6 +51,7 @@ static const struct option long_options[] = {
|
50
|
51
|
{ "version", no_argument, NULL, 'V' },
|
51
|
52
|
{ "info", no_argument, NULL, 'i' },
|
52
|
53
|
{ "monitor", no_argument, NULL, 'm' },
|
|
54
|
+ { "backup", no_argument, NULL, 'b' },
|
53
|
55
|
{ "list-device", no_argument, NULL, 901 },
|
54
|
56
|
{ "list-vinputs", no_argument, NULL, 902 },
|
55
|
57
|
{ "list-voutputs", no_argument, NULL, 903 },
|
|
@@ -81,6 +83,8 @@ static void show_help(struct videohub_data *data) {
|
81
|
83
|
printf(" . This command is shows the equivallent of\n");
|
82
|
84
|
printf(" . running all --list-XXX commands.\n");
|
83
|
85
|
printf(" -m --monitor | Display real-time config changes monitor.\n");
|
|
86
|
+ printf(" -b --backup | Show the command line that will restore\n");
|
|
87
|
+ printf(" . the device to the current configuration.\n");
|
84
|
88
|
printf("\n");
|
85
|
89
|
printf(" --list-device | Display device info.\n");
|
86
|
90
|
printf(" --list-vinputs | List device video inputs.\n");
|
|
@@ -137,6 +141,9 @@ static void parse_options(struct videohub_data *data, int argc, char **argv) {
|
137
|
141
|
case 'm': // --monitor
|
138
|
142
|
show_monitor = 1;
|
139
|
143
|
break;
|
|
144
|
+ case 'b': // --backup
|
|
145
|
+ show_backup = 1;
|
|
146
|
+ break;
|
140
|
147
|
case 901: show_list |= action_list_device; break; // --list-device
|
141
|
148
|
case 902: show_list |= action_list_vinputs; break; // --list-vinputs
|
142
|
149
|
case 903: show_list |= action_list_voutputs; break; // --list-voutputs
|
|
@@ -285,6 +292,8 @@ int main(int argc, char **argv) {
|
285
|
292
|
if (show_list & action_list_vinputs) print_device_video_inputs(data);
|
286
|
293
|
if (show_list & action_list_voutputs) print_device_video_outputs(data);
|
287
|
294
|
fflush(stdout);
|
|
295
|
+ } else if (show_backup) {
|
|
296
|
+ print_device_backup(data);
|
288
|
297
|
} else if (show_info) {
|
289
|
298
|
print_device_info(data);
|
290
|
299
|
print_device_video_inputs(data);
|