summaryrefslogtreecommitdiff
path: root/src/info.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-01-06 10:38:23 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2012-01-06 10:38:23 +0100
commit09b28210a221c76391f115b72b39912a84db98dd (patch)
tree5300cc2b4642b625827a9e3fa135efbb54ff36d1 /src/info.c
parent92c75d6b3332add96277ae91bbda5b07bde9b242 (diff)
downloadapk-tools-09b28210a221c76391f115b72b39912a84db98dd.tar.gz
apk-tools-09b28210a221c76391f115b72b39912a84db98dd.tar.bz2
apk-tools-09b28210a221c76391f115b72b39912a84db98dd.tar.xz
apk-tools-09b28210a221c76391f115b72b39912a84db98dd.zip
info: display short info if packages are given
instead of just list all installed package
Diffstat (limited to 'src/info.c')
-rw-r--r--src/info.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/info.c b/src/info.c
index 9135a33..25731cc 100644
--- a/src/info.c
+++ b/src/info.c
@@ -436,6 +436,13 @@ static int info_parse(void *ctx, struct apk_db_options *dbopts,
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)
{
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)
if (ictx->action != NULL)
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);
}