From: Richard W.M. Jones Date: Fri, 19 Nov 2010 13:05:49 +0000 (+0000) Subject: cat: Give a better error if the user specified no drives on command line. X-Git-Tag: 1.7.11~6 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=3bd883f344a5d6f155f7252e8a478d5b7935d7c6;p=libguestfs.git cat: Give a better error if the user specified no drives on command line. --- diff --git a/cat/virt-cat.c b/cat/virt-cat.c index 58ebd8e..3510a94 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. */