Error out if package isn't found instead of listing all properties.
authorRichard Hughes <richard@hughsie.com>
Wed Jun 25 11:00:25 2008 -0400 (2008-06-25)
changeset 28025407a621c95
parent 279 5a20654e903c
child 281 d8d248598628
Error out if package isn't found instead of listing all properties.

committer: Kristian H?gsberg <krh@redhat.com>
src/main.c
     1.1 --- a/src/main.c	Mon Jun 23 21:38:33 2008 -0400
     1.2 +++ b/src/main.c	Wed Jun 25 11:00:25 2008 -0400
     1.3 @@ -85,9 +85,13 @@
     1.4  	uint32_t flags;
     1.5  
     1.6  	set = razor_set_open(repo_filename);
     1.7 -	if (package_name)
     1.8 +	if (package_name) {
     1.9  		package = razor_set_get_package(set, package_name);
    1.10 -	else
    1.11 +		if (!package) {
    1.12 +			fprintf(stderr, "no package named \"%s\"\n", package_name);
    1.13 +			return 1;
    1.14 +		}
    1.15 +	} else
    1.16  		package = NULL;
    1.17  
    1.18  	pi = razor_property_iterator_create(set, package);