GOptionContext *context;
GError *error = NULL;
gboolean version = 0;
- gchar *vnc = NULL;
gchar **args = NULL;
guint nr_args;
const GOptionEntry options [] = {
&verbose, "Enables verbose output", NULL },
{ "version", 'V', 0, G_OPTION_ARG_NONE,
&version, "Display version and exit", NULL },
- { "vnc", 0, 0, G_OPTION_ARG_STRING,
- &vnc, "Connect to VNC server directly", NULL },
{ G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &args,
NULL, "(click|...) [args...]" },
{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, 0 }
" click x y [b] Mouse click at (x, y), with button b"
);
g_option_context_add_main_entries (context, options, NULL);
+ g_option_context_add_group (context, vc_vnc_cmdline_get_option_group ());
+ g_option_context_add_group (context, vc_spice_cmdline_get_option_group ());
g_option_context_parse (context, &argc, &argv, &error);
if (error) {
short_usage (argv[0], error->message);
}
/* Create VNC/SPICE/... object. */
- if (vnc)
- vc_vnc_setup (self, vnc);
+ if (vc_vnc_is_selected ())
+ vc_vnc_setup (self);
+ else if (vc_spice_is_selected ()) {
+ vc_spice_setup (self);
+ }
else {
short_usage (argv[0], "no --vnc or --spice option");
exit (EXIT_FAILURE);