summaryrefslogtreecommitdiffstats
path: root/cat/virt-cat.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2010-11-19 13:05:49 +0000
committerRichard W.M. Jones <rjones@redhat.com>2010-11-19 13:06:22 +0000
commit3bd883f344a5d6f155f7252e8a478d5b7935d7c6 (patch)
tree0fa74d342f67dbfa760f792da530d381bcc25408 /cat/virt-cat.c
parent06e993b7bac2fa1d506b24848c4ffddbdfdf49bc (diff)
downloadlibguestfs-3bd883f344a5d6f155f7252e8a478d5b7935d7c6.tar.gz
libguestfs-3bd883f344a5d6f155f7252e8a478d5b7935d7c6.tar.xz
libguestfs-3bd883f344a5d6f155f7252e8a478d5b7935d7c6.zip
cat: Give a better error if the user specified no drives on command line.
Diffstat (limited to 'cat/virt-cat.c')
-rw-r--r--cat/virt-cat.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cat/virt-cat.c b/cat/virt-cat.c
index 58ebd8ec..3510a948 100644
--- a/cat/virt-cat.c
+++ b/cat/virt-cat.c
@@ -220,6 +220,10 @@ main (int argc, char *argv[])
if (optind >= argc || argc - optind < 1)
usage (EXIT_FAILURE);
+ /* User must have specified some drives. */
+ if (drvs == NULL)
+ usage (EXIT_FAILURE);
+
/* Add drives, inspect and mount. Note that inspector is always true,
* and there is no -m option.
*/