Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
issue #403: Switch from 'pkg -n' to 'pkg -N' as the one true pkgng activation status check. Confusion was possible because'-n' was already used extensively elsewhere on the command lines to mean 'dry-run', whereas '-N' is otherwise currently unused.
Matthew Seaman committed 13 years ago
commit 4a444e6b155a84c5407f4d92c63ac246660996bb
parent 75dbdd7
2 files changed +13 -13
modified pkg/main.c
@@ -126,9 +126,9 @@ usage(void)
	bool plugins_enabled = false;

#ifndef NO_LIBJAIL
-
 	fprintf(stderr, "usage: pkg [-v] [-d] [-n] [-j <jail name or id>|-c <chroot path>] <command> [<args>]\n\n");
+
 	fprintf(stderr, "usage: pkg [-v] [-d] [-N] [-j <jail name or id>|-c <chroot path>] <command> [<args>]\n\n");
#else
-
	fprintf(stderr, "usage: pkg [-v] [-d] [-n] [-c <chroot path>] <command> [<args>]\n\n");
+
	fprintf(stderr, "usage: pkg [-v] [-d] [-N] [-c <chroot path>] <command> [<args>]\n\n");
#endif
	fprintf(stderr, "Global options supported:\n");
	fprintf(stderr, "\t%-15s%s\n", "-d", "Increment debug level");
@@ -137,7 +137,7 @@ usage(void)
#endif
	fprintf(stderr, "\t%-15s%s\n", "-c", "Execute pkg(1) inside a chroot(8)");
	fprintf(stderr, "\t%-15s%s\n\n", "-v", "Display pkg(1) version");
-
	fprintf(stderr, "\t%-15s%s\n\n", "-n", "Test if pkg(1) is activated and avoid auto-activation");
+
	fprintf(stderr, "\t%-15s%s\n\n", "-N", "Test if pkg(1) is activated and avoid auto-activation");
	fprintf(stderr, "Commands supported:\n");

	for (unsigned int i = 0; i < cmd_len; i++)
@@ -245,9 +245,9 @@ main(int argc, char **argv)
		usage();

#ifndef NO_LIBJAIL
-
	while ((ch = getopt(argc, argv, "dj:c:lnvq")) != -1) {
+
	while ((ch = getopt(argc, argv, "dj:c:lNvq")) != -1) {
#else
-
	while ((ch = getopt(argc, argv, "d:c:lnvq")) != -1) {
+
	while ((ch = getopt(argc, argv, "d:c:lNvq")) != -1) {
#endif
		switch (ch) {
		case 'd':
@@ -264,7 +264,7 @@ main(int argc, char **argv)
		case 'l':
			show_commands = true;
			break;
-
		case 'n':
+
		case 'N':
			activation_test = true;
			break;
		case 'v':
modified pkg/pkg.8
@@ -29,7 +29,7 @@
.Op Fl v
.Op Fl d
.Op Fl l
-
.Op Fl n
+
.Op Fl N
.Op Fl j Ao jail name or id Ac | Fl c Ao chroot path Ac
.Ao command Ac Ao Ar flags Ac
.\" ---------------------------------------------------------------------------
@@ -65,8 +65,8 @@ option takes precedence over
but
.Fl l
will override any other command line arguments.
-
.It Fl n
-
Sanity check mode.
+
.It Fl N
+
Activation status check mode.
Prevent
.Nm
from automatically creating or initializing the sqlite database in
@@ -83,10 +83,10 @@ will always have at least the
package itself registered.
.Pp
If used without any other arguments,
-
.Nm Fl n
-
will run the sanity tests and print out a short message showing how
-
many packages are currently installed.
-
The exit status should be a reliable indication of whether the system
+
.Nm Fl N
+
will run the sanity tests and if successful print out a short message
+
showing how many packages are currently installed.
+
The exit status should be a reliable indication of whether a system
is configured to use
.Nm
as its package management system or not.