Exit early when listing installable bundles

It is not necessary to go through the whole swupd initiation process a
second time when listing bundles from the server. This also allows us to
set the correct exit status on the early exit.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
This commit is contained in:
Matthew Johnson
2017-08-10 15:33:59 -07:00
parent ae011954f4
commit c70cce7368
+4 -1
View File
@@ -75,7 +75,10 @@ static bool parse_options(int argc, char **argv)
print_help(argv[0]);
exit(EXIT_SUCCESS);
case 'a':
return list_installable_bundles();
/* Exit early, we do not need to init swupd locally just to get a
* list from the server
* list_installable_bundles will supply the exit status */
exit(list_installable_bundles());
break;
case 'u':
if (!optarg) {