summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-01-01 15:12:20 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-01-01 15:12:20 +0000
commit7ff3ad054bc203e46912c526f52de0b727263e09 (patch)
tree4dd0e136612a66e820d11201fa69cb7cf81aaf82 /src
parent15bc6e5508cf8e083f161f353ba12a9af4a89c56 (diff)
downloadpacman-7ff3ad054bc203e46912c526f52de0b727263e09.tar.xz
- reworked verbose levels
- fixed the handling of command line errors when no operation is specified
Diffstat (limited to 'src')
-rw-r--r--src/pacman/log.c2
-rw-r--r--src/pacman/pacman.c12
-rw-r--r--src/pacman/sync.c2
3 files changed, 5 insertions, 11 deletions
diff --git a/src/pacman/log.c b/src/pacman/log.c
index 52801c7b..5654c5a8 100644
--- a/src/pacman/log.c
+++ b/src/pacman/log.c
@@ -103,7 +103,7 @@ void vprint(char *fmt, ...)
{
va_list args;
- if(config->verbose > 1) {
+ if(config->verbose > 0) {
if(neednl == 1) {
fprintf(stdout, "\n");
neednl = 0;
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 016296cb..40d9b5cf 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -75,11 +75,6 @@ int main(int argc, char *argv[])
maxcols = atoi(cenv);
}
- if(argc < 2) {
- usage(PM_OP_MAIN, basename(argv[0]));
- return(0);
- }
-
/* set signal handlers */
signal(SIGINT, cleanup);
signal(SIGTERM, cleanup);
@@ -90,8 +85,8 @@ int main(int argc, char *argv[])
ERR(NL, "could not allocate memory for pacman config data.\n");
return(1);
}
- config->op = PM_OP_MAIN;
- config->debug |= PM_LOG_WARNING | PM_LOG_ERROR;
+ config->op = PM_OP_MAIN;
+ config->debug |= PM_LOG_WARNING | PM_LOG_ERROR;
/* parse the command line */
ret = parseargs(argc, argv);
@@ -179,7 +174,7 @@ int main(int argc, char *argv[])
}
}
- if(config->verbose > 1) {
+ if(config->verbose > 0) {
printf("Root : %s\n", config->root);
printf("DBPath: %s\n", config->dbpath);
list_display("Targets:", pm_targets);
@@ -200,7 +195,6 @@ int main(int argc, char *argv[])
case PM_OP_QUERY: ret = pacman_query(pm_targets); break;
case PM_OP_SYNC: ret = pacman_sync(pm_targets); break;
case PM_OP_DEPTEST: ret = pacman_deptest(pm_targets); break;
- case PM_OP_MAIN: ret = 0; break;
default:
ERR(NL, "no operation specified (use -h for help)\n");
ret = 1;
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index b1499fb7..c25175da 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -253,7 +253,7 @@ static int sync_group(list_t *syncs, list_t *targets)
PM_GRP *grp = alpm_list_getdata(lp);
MSG(NL, "%s/%s\n", (char *)sync->treename, (char *)alpm_grp_getinfo(grp, PM_GRP_NAME));
- if(config->verbose > 1) {
+ if(config->verbose > 0) {
PM_LIST_display(" ", alpm_grp_getinfo(grp, PM_GRP_PKGNAMES));
}
}