mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-10 13:28:12 -05:00
pacman/pacman.c : add --logfile option.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
This commit is contained in:
parent
920b0d2049
commit
e03a1f0044
@ -140,6 +140,7 @@ static void usage(int op, char *myname)
|
||||
printf(_(" --ignore <pkg> ignore a package upgrade (can be used more than once)\n"));
|
||||
}
|
||||
printf(_(" --config <path> set an alternate configuration file\n"));
|
||||
printf(_(" --logfile <path> set an alternate log file\n"));
|
||||
printf(_(" --noconfirm do not ask for any confirmation\n"));
|
||||
printf(_(" --noprogressbar do not show a progress bar when downloading files\n"));
|
||||
printf(_(" --noscriptlet do not execute the install scriptlet if one exists\n"));
|
||||
@ -286,6 +287,7 @@ static int parseargs(int argc, char *argv[])
|
||||
{"noscriptlet", no_argument, 0, 1005},
|
||||
{"cachedir", required_argument, 0, 1007},
|
||||
{"asdeps", no_argument, 0, 1008},
|
||||
{"logfile", required_argument, 0, 1009},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@ -338,6 +340,14 @@ static int parseargs(int argc, char *argv[])
|
||||
case 1008:
|
||||
config->flags |= PM_TRANS_FLAG_ALLDEPS;
|
||||
break;
|
||||
case 1009:
|
||||
if(alpm_option_set_logfile(optarg) != 0) {
|
||||
pm_printf(PM_LOG_ERROR, _("problem setting logfile '%s' (%s)\n"),
|
||||
optarg, alpm_strerrorlast());
|
||||
return(1);
|
||||
}
|
||||
config->have_logfile = 1;
|
||||
break;
|
||||
case 'A': config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_ADD); break;
|
||||
case 'F':
|
||||
config->op = (config->op != PM_OP_MAIN ? 0 : PM_OP_UPGRADE);
|
||||
|
Loading…
Reference in New Issue
Block a user