summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-main.c
diff options
context:
space:
mode:
authorPavel Grunt <pgrunt@redhat.com>2014-10-03 17:02:02 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2014-10-10 12:57:08 +0200
commit88f634179e56742a21fb4c7efc270e4203322d74 (patch)
tree2db42150df3f9ab43dd97697cccc75f64d28d236 /src/virt-viewer-main.c
parent7a47a4da08acf17efd95f5afc2aeb220ee31443c (diff)
downloadvirt-viewer-88f634179e56742a21fb4c7efc270e4203322d74.tar.gz
virt-viewer-88f634179e56742a21fb4c7efc270e4203322d74.tar.xz
virt-viewer-88f634179e56742a21fb4c7efc270e4203322d74.zip
Show VM chooser dialog when starting virt-viewer with no arg
When user starts virt-viewer without specifying VM domain name or with a wrong name a list of running machines is shown and user may choose one of them.
Diffstat (limited to 'src/virt-viewer-main.c')
-rw-r--r--src/virt-viewer-main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/virt-viewer-main.c b/src/virt-viewer-main.c
index 44d1182..3fae955 100644
--- a/src/virt-viewer-main.c
+++ b/src/virt-viewer-main.c
@@ -104,12 +104,12 @@ int main(int argc, char **argv)
g_option_context_free(context);
- if (!args || (g_strv_length(args) != 1)) {
+ if (args && (g_strv_length(args) != 1)) {
g_printerr(_("\nUsage: %s [OPTIONS] DOMAIN-NAME|ID|UUID\n\n%s\n\n"), argv[0], help_msg);
goto cleanup;
}
- viewer = virt_viewer_new(uri, args[0], direct, attach, waitvm, reconnect);
+ viewer = virt_viewer_new(uri, (args) ? args[0] : NULL, direct, attach, waitvm, reconnect);
if (viewer == NULL)
goto cleanup;