- reworked verbose levels
- fixed the handling of command line errors when no operation is specified
This commit is contained in:
parent
15bc6e5508
commit
7ff3ad054b
|
@ -103,7 +103,7 @@ void vprint(char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
if(config->verbose > 1) {
|
if(config->verbose > 0) {
|
||||||
if(neednl == 1) {
|
if(neednl == 1) {
|
||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
neednl = 0;
|
neednl = 0;
|
||||||
|
|
|
@ -75,11 +75,6 @@ int main(int argc, char *argv[])
|
||||||
maxcols = atoi(cenv);
|
maxcols = atoi(cenv);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(argc < 2) {
|
|
||||||
usage(PM_OP_MAIN, basename(argv[0]));
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* set signal handlers */
|
/* set signal handlers */
|
||||||
signal(SIGINT, cleanup);
|
signal(SIGINT, cleanup);
|
||||||
signal(SIGTERM, cleanup);
|
signal(SIGTERM, cleanup);
|
||||||
|
@ -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("Root : %s\n", config->root);
|
||||||
printf("DBPath: %s\n", config->dbpath);
|
printf("DBPath: %s\n", config->dbpath);
|
||||||
list_display("Targets:", pm_targets);
|
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_QUERY: ret = pacman_query(pm_targets); break;
|
||||||
case PM_OP_SYNC: ret = pacman_sync(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_DEPTEST: ret = pacman_deptest(pm_targets); break;
|
||||||
case PM_OP_MAIN: ret = 0; break;
|
|
||||||
default:
|
default:
|
||||||
ERR(NL, "no operation specified (use -h for help)\n");
|
ERR(NL, "no operation specified (use -h for help)\n");
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
|
|
@ -253,7 +253,7 @@ static int sync_group(list_t *syncs, list_t *targets)
|
||||||
PM_GRP *grp = alpm_list_getdata(lp);
|
PM_GRP *grp = alpm_list_getdata(lp);
|
||||||
|
|
||||||
MSG(NL, "%s/%s\n", (char *)sync->treename, (char *)alpm_grp_getinfo(grp, PM_GRP_NAME));
|
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));
|
PM_LIST_display(" ", alpm_grp_getinfo(grp, PM_GRP_PKGNAMES));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue