summaryrefslogtreecommitdiff
path: root/src/pacman/pacman.c
diff options
context:
space:
mode:
authorNathan Jones <nathanj@insightbb.com>2007-05-14 01:21:42 -0400
committerDan McGee <dan@archlinux.org>2007-05-14 01:22:15 -0400
commit5c930c318e7b80af3a322ddc7ddf9fe100e9c16b (patch)
treef0a5480fe7d324f8c66041ed36699c9168259f58 /src/pacman/pacman.c
parent14c768365cc32659d0adf0887f93c39d340089fc (diff)
Display size for packages
This patch adds a -z|--showsize option to the -Q and -S commands. The option displays the size of individual packages. This is something that I have wanted for a while, and there is a feature request for it. Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/pacman.c')
-rw-r--r--src/pacman/pacman.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 1f5c5aed..fe70ea10 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -131,6 +131,7 @@ static void usage(int op, char *myname)
printf(_(" -p, --file <package> query a package file instead of the database\n"));
printf(_(" -s, --search <regex> search locally-installed packages for matching strings\n"));
printf(_(" -u, --upgrades list all packages that can be upgraded\n"));
+ printf(_(" -z, --showsize display installed size of each package\n"));
} else if(op == PM_OP_SYNC) {
printf("%s: %s {-S --sync} [%s] [%s]\n", str_usg, myname, str_opt, str_pkg);
printf("%s:\n", str_opt);
@@ -146,6 +147,7 @@ static void usage(int op, char *myname)
printf(_(" -u, --sysupgrade upgrade all packages that are out of date\n"));
printf(_(" -w, --downloadonly download packages but do not install/upgrade anything\n"));
printf(_(" -y, --refresh download fresh package databases from the server\n"));
+ printf(_(" -z, --showsize display download size of each package\n"));
printf(_(" --ignore <pkg> ignore a package upgrade (can be used more than once)\n"));
}
printf(_(" --config <path> set an alternate configuration file\n"));
@@ -291,6 +293,7 @@ static int parseargs(int argc, char *argv[])
{"verbose", no_argument, 0, 'v'},
{"downloadonly", no_argument, 0, 'w'},
{"refresh", no_argument, 0, 'y'},
+ {"showsize", no_argument, 0, 'z'},
{"noconfirm", no_argument, 0, 1000},
{"config", required_argument, 0, 1001},
{"ignore", required_argument, 0, 1002},
@@ -304,7 +307,7 @@ static int parseargs(int argc, char *argv[])
struct stat st;
unsigned short logmask;
- while((opt = getopt_long(argc, argv, "ARUFQSTr:b:vkhscVfmnoldepiuwyg", opts, &option_index))) {
+ while((opt = getopt_long(argc, argv, "ARUFQSTr:b:vkhscVfmnoldepiuwygz", opts, &option_index))) {
if(opt < 0) {
break;
}
@@ -423,6 +426,7 @@ static int parseargs(int argc, char *argv[])
config->flags |= PM_TRANS_FLAG_NOCONFLICTS;
break;
case 'y': (config->op_s_sync)++; break;
+ case 'z': config->showsize = 1; break;
case '?': return(1);
default: return(1);
}