Commit dc35acba authored by Tobias Kortkamp's avatar Tobias Kortkamp Committed by Baptiste Daroussin
Browse files

autoremove: Add --no-scripts same as install and delete

parent 62302ab4
......@@ -14,7 +14,7 @@
.\"
.\" @(#)pkg.8
.\"
.Dd May 25, 2014
.Dd May 3, 2021
.Dt PKG-AUTOREMOVE 8
.Os
.Sh NAME
......@@ -22,10 +22,10 @@
.Nd removes orphan packages
.Sh SYNOPSIS
.Nm
.Op Fl nqy
.Op Fl Dnqy
.Pp
.Nm
.Op Cm --{dry-run,quiet,yes}
.Op Cm --{dry-run,no-scripts,quiet,yes}
.Sh DESCRIPTION
.Nm
is used for removing orphan packages, which were installed
......@@ -38,6 +38,8 @@ The following options are supported by
Dry-run mode.
The list of changes to packages is always printed, but
no changes are actually made.
.It Fl D , Cm --no-scripts
If a deinstallation script exists for a given package, do not execute it.
.It Fl q , Cm --quiet
Force quiet output.
.It Fl y , Cm --yes
......
......@@ -39,7 +39,7 @@
void
usage_autoremove(void)
{
fprintf(stderr, "Usage: pkg autoremove [-ynq]\n\n");
fprintf(stderr, "Usage: pkg autoremove [-Dynq]\n\n");
fprintf(stderr, "For more information see 'pkg help autoremove'.\n");
}
......@@ -57,18 +57,22 @@ exec_autoremove(int argc, char **argv)
struct option longopts[] = {
{ "dry-run", no_argument, NULL, 'n' },
{ "no-scripts", no_argument, NULL, 'D' },
{ "quiet", no_argument, NULL, 'q' },
{ "yes", no_argument, NULL, 'y' },
{ NULL, 0, NULL, 0 },
};
while ((ch = getopt_long(argc, argv, "+nqy", longopts, NULL)) != -1) {
while ((ch = getopt_long(argc, argv, "+Dnqy", longopts, NULL)) != -1) {
switch (ch) {
case 'n':
f |= PKG_FLAG_DRY_RUN;
dry_run = true;
lock_type = PKGDB_LOCK_READONLY;
break;
case 'D':
f |= PKG_FLAG_NOSCRIPT;
break;
case 'q':
quiet = true;
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment