Commit 09b28210 authored by Natanael Copa's avatar Natanael Copa

info: display short info if packages are given

instead of just list all installed package
parent 92c75d6b
...@@ -436,6 +436,13 @@ static int info_parse(void *ctx, struct apk_db_options *dbopts, ...@@ -436,6 +436,13 @@ static int info_parse(void *ctx, struct apk_db_options *dbopts,
return 0; return 0;
} }
static int info_package_short(struct info_ctx *ictx, struct apk_database *db,
int argc, char **argv)
{
ictx->subaction_mask |= APK_INFO_DESC | APK_INFO_URL | APK_INFO_SIZE;
return info_package(ictx, db, argc, argv);
}
static int info_main(void *ctx, struct apk_database *db, int argc, char **argv) static int info_main(void *ctx, struct apk_database *db, int argc, char **argv)
{ {
struct info_ctx *ictx = (struct info_ctx *) ctx; struct info_ctx *ictx = (struct info_ctx *) ctx;
...@@ -444,6 +451,9 @@ static int info_main(void *ctx, struct apk_database *db, int argc, char **argv) ...@@ -444,6 +451,9 @@ static int info_main(void *ctx, struct apk_database *db, int argc, char **argv)
if (ictx->action != NULL) if (ictx->action != NULL)
return ictx->action(ictx, db, argc, argv); return ictx->action(ictx, db, argc, argv);
if (argc > 0)
return info_package_short(ictx, db, argc, argv);
return info_list(ictx, db, argc, argv); return info_list(ictx, db, argc, argv);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment