mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
- 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;
|
||||
|
||||
if(config->verbose > 1) {
|
||||
if(config->verbose > 0) {
|
||||
if(neednl == 1) {
|
||||
fprintf(stdout, "\n");
|
||||
neednl = 0;
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user