1
0
mirror of https://github.com/openSUSE/libsolv.git synced 2026-02-05 12:45:46 +01:00

Improve alternatives listing in example solver

This commit is contained in:
Michael Schroeder
2016-05-20 15:00:19 +02:00
parent 5f8f396d87
commit f3737bb6ae

View File

@@ -767,7 +767,17 @@ rerunsolver:
acnt = solver_alternatives_count(solv);
if (acnt)
{
printf("Have %d alternatives\n\n", acnt);
if (acnt == 1)
printf("Have one alternative:\n");
else
printf("Have %d alternatives:\n", acnt);
for (i = 1; i <= acnt; i++)
{
Id id, from;
int atype = solver_get_alternative(solv, i, &id, &from, 0, 0, 0);
printf(" - %s\n", solver_alternative2str(solv, atype, id, from));
}
printf("\n");
answer = yesno("OK to continue (y/n/a)? ", 'a');
}
else