static int response_callback(struct pakfire_xfer* xfer,
const pakfire_xfer_response* response, void* data) {
struct cli_local_args* local_args = data;
+ const char* description = NULL;
json_object* repo = NULL;
cli_table* table = NULL;
const char* name = NULL;
if (r < 0)
goto ERROR;
+ r = cli_table_add_col(table, "Description", CLI_TABLE_STRING);
+ if (r < 0)
+ goto ERROR;
+
// Loop through all repos
for (size_t i = 0; i < json_object_array_length(response->data); i++) {
repo = json_object_array_get_idx(response->data, i);
if (r < 0)
goto ERROR;
+ // Fetch the description
+ r = pakfire_json_get_string(repo, "description", &description);
+ if (r < 0)
+ goto ERROR;
+
// Add a new row to the table
- r = cli_table_add_row(table, name, priority);
+ r = cli_table_add_row(table, name, priority, description);
if (r < 0)
goto ERROR;
}