Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add -gxX flags to 'pkg delete' and update man pages
Marin Atanasov Nikolov committed 14 years ago
commit 76aaae6e03e900642f6b21294fb131e3bbc2ab65
parent 5ec5ebb
4 files changed +31 -7
modified pkg/delete.c
@@ -13,7 +13,7 @@
void
usage_delete(void)
{
-
	fprintf(stderr, "usage: pkg delete [-yf] <pkg-name> <...>\n");
+
	fprintf(stderr, "usage: pkg delete [-ygxXf] <pkg-name> <...>\n");
	fprintf(stderr, "       pkg delete [-y] -a\n\n");
	fprintf(stderr, "For more information see 'pkg help delete'.\n");
}
@@ -32,11 +32,20 @@ exec_delete(int argc, char **argv)
	int yes = 0;
	int retcode = EPKG_OK;

-
	while ((ch = getopt(argc, argv, "afy")) != -1) {
+
	while ((ch = getopt(argc, argv, "agxXfy")) != -1) {
		switch (ch) {
			case 'a':
				match = MATCH_ALL;
				break;
+
			case 'g':
+
				match = MATCH_GLOB;
+
				break;
+
			case 'x':
+
				match = MATCH_REGEX;
+
				break;
+
			case 'X':
+
				match = MATCH_EREGEX;
+
				break;
			case 'f':
				force = 1;
				break;
@@ -48,6 +57,7 @@ exec_delete(int argc, char **argv)
				return (EX_USAGE);
		}
	}
+

	argc -= optind;
	argv += optind;

modified pkg/pkg-autoremove.1
@@ -23,6 +23,7 @@
.Nd removes orphan packages
.Sh SYNOPSIS
.Nm
+
.Op Fl y
.Sh DESCRIPTION
.Nm
is used for removing orphan packages, which were installed
@@ -31,6 +32,8 @@ during a dependencies resolving and are no longer needed.
The following options are supported by
.Nm :
.Bl -tag -width F1
+
.It Fl y
+
Assume yes when asked for confirmation before package autoremoval.
.El
.Sh WARNING
.Sh ENVRIOMENT
modified pkg/pkg-delete.1
@@ -23,10 +23,10 @@
.Nd deletes a package from the database and the system
.Sh SYNOPSIS
.Nm
-
.Op Fl a 
+
.Op Fl ay
.Nm
-
.Op Fl f
-
.Ar <pkg-name>
+
.Op Fl gxXyf
+
.Ar <pkg-name> <...>
.Sh DESCRIPTION
.Nm
is used for deleting previously installed packages and removes them from the 
@@ -35,10 +35,18 @@ database.
The following options are supported by
.Nm :
.Bl -tag -width F1
-
.It Fl f Ar <pkg-name>
-
Forces a package to be removed.
+
.It Fl f
+
Forces packages to be removed.
.It Fl a
Deletes all installed packages from the system and the database.
+
.It Fl y
+
Assume yes when asked for confirmation before package deletion.
+
.It Fl g
+
Treat the package names as shell glob patterns.
+
.It Fl x
+
Treat the package names as regular expressions.
+
.It Fl X
+
Treat the package names as extended regular expressions.
.El
.Sh WARNING
.Sh ENVRIOMENT
modified pkg/pkg-install.1
@@ -23,6 +23,7 @@
.Nd install packages from remote package repositories
.Sh SYNOPSIS
.Nm
+
.Op Fl y
.Ar <pkg-origin> <...>
.Sh DESCRIPTION
.Nm
@@ -55,6 +56,8 @@ man page.
The following options are supported by
.Nm :
.Bl -tag -width F1
+
.It Fl y
+
Assume yes when asked for confirmation before package installation.
.El
.Sh WARNING
.Sh ENVRIOMENT