Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Change pkg-search -M option to -Q (for "Query modifier") -- reserve '-M' as an option and %M as a format code for 'Meta': free-format meta data added to the pkg manifest as key-value pairs. (To be implemented...)'
Matthew Seaman committed 13 years ago
commit 925992e682291e4e1b444a65eb0af02c00147c56
parent 302895a
2 files changed +32 -32
modified pkg/pkg-search.8
@@ -27,7 +27,7 @@
.Op Fl r Ar repo
.Op Fl S Ar search
.Op Fl L Ar label
-
.Op Fl M Ar mod
+
.Op Fl Q Ar query-modifier
.Ar pattern
.Nm
.Op Fl cDdefgopqx
@@ -70,14 +70,14 @@ Equivalent to
.It Fl d
Display the list of packages depended on by each matched package.
Equivalent to
-
.Fl "M depends-on" .
+
.Fl "Q depends-on" .
.It Fl e
.Ar pattern
should be an exact match against the search field.
.It Fl f
Show ``full'' information about the package.
Equivalent to
-
.Fl "M full" .
+
.Fl "Q full" .
.It Fl g
Treat
.Ar pattern
@@ -100,14 +100,6 @@ If unspecified,
is set to the same as the value searched via the
.Fl S Ar search
option.
-
.It Fl M Ar mod
-
Modify the output by adding an additional field to the result.
-
Multiple fields can be added by using additional
-
.Fl M Ar mod
-
flags.
-
See the
-
.Qq Sx Output Modifier Options
-
section for details.
.It Fl o
List packages by origin for each package matching
.Ar pattern .
@@ -116,11 +108,19 @@ Equivalent to
.It Fl p
Display the package installation prefix for each matched package.
Equivalent to
-
.Fl "M prefix" .
+
.Fl "Q prefix" .
.It Fl q
Be ``quiet''.
Produce less output.
In particular do not show an identifying label field for each package.
+
.It Fl Q Ar query-modifier
+
Modify the query output by adding an additional field to the result.
+
Multiple fields can be added by using additional
+
.Fl Q Ar query-modifier
+
flags.
+
See the
+
.Qq Sx Output Modifier Options
+
section for details.
.It Fl r Ar repo
In multi-repo mode, select only the repository catalogue from
.Sy repo
@@ -143,7 +143,7 @@ sections for more details.
.It Fl s
Display the installed size of matched packages.
Equivalent to
-
.Fl "M size" .
+
.Fl "Q size" .
.It Fl x
Treat
.Ar pattern
@@ -168,7 +168,7 @@ variable in the port's
When chosen as a label option, the output format will additionally
include the packge name, equivalent to
.Fl "L pkg-name"
-
.Fl "M comment" .
+
.Fl "Q comment" .
When chosen as a search option, only the
.Sy comment
field is used for sorting the output.
@@ -182,7 +182,7 @@ URL reference, if any, from that file.
When chosen as a label option, the output format will additionally
include the package name, equivalent to
.Fl "L pkg-name"
-
.Fl "M description" .
+
.Fl "Q description" .
When chosen as a search option, only the
.Sy description
field is used for sorting the output.
@@ -216,9 +216,9 @@ Additional data from the repository catalogue to print for each matched
package.
Multiple output modifiers can be combined.
Where more than one output field is required, either because multiple
-
.Fl M Ar mod
+
.Fl Q Ar query-modifier
options were given, or one or more
-
.Fl M Ar mod
+
.Fl Q Ar query-modifier
option was combined with the
.Fl "L comment"
or
@@ -351,18 +351,18 @@ This is extracted from the
file in the port.
.El
.Pp
-
Any unambiguous prefix of the modifier name may be used on the command
-
line.
+
Any unambiguous prefix of the query modifier name may be used on the
+
command line.
Thus
-
.Fl "Mm" ,
-
.Fl "M maint"
+
.Fl "Qm" ,
+
.Fl "Q maint"
and
-
.Fl "M maintainer"
+
.Fl "Q maintainer"
are all equivalent,
but you need to use at least
-
.Fl "M si"
+
.Fl "Q si"
and
-
.Fl "M sh"
+
.Fl "Q sh"
to distinguish
.Cm size
from
modified pkg/search.c
@@ -243,7 +243,7 @@ exec_search(int argc, char **argv)
	struct pkg *pkg = NULL;
	bool atleastone = false;

-
	while ((ch = getopt(argc, argv, "cDdefgL:M:opqr:S:sx")) != -1) {
+
	while ((ch = getopt(argc, argv, "cDdefgL:opqQ:r:S:sx")) != -1) {
		switch (ch) {
		case 'c':	/* Same as -S comment */
			search = search_label_opt("comment");
@@ -251,13 +251,13 @@ exec_search(int argc, char **argv)
		case 'D':	/* Same as -S description */
			search = search_label_opt("description");
			break;
-
		case 'd':	/* Same as -M depends-on  */
+
		case 'd':	/* Same as -Q depends-on  */
			opt |= modifier_opt("depends-on");
			break;
		case 'e':
			match = MATCH_EXACT;
			break;
-
		case 'f':	/* Same as -M full */
+
		case 'f':	/* Same as -Q full */
			opt |= modifier_opt("full");
			break;
		case 'g':
@@ -266,25 +266,25 @@ exec_search(int argc, char **argv)
		case 'L':
			label = search_label_opt(optarg);
			break;
-
		case 'M':
-
			opt |= modifier_opt(optarg);
-
			break;
		case 'o':	/* Same as -L origin */
			label = search_label_opt("origin");
			break;
-
		case 'p':	/* Same as -M prefix */
+
		case 'p':	/* Same as -Q prefix */
			opt |= modifier_opt("prefix");
			break;
		case 'q':
			quiet = true;
			break;
+
		case 'Q':
+
			opt |= modifier_opt(optarg);
+
			break;
		case 'r':
			reponame = optarg;
			break;
		case 'S':
			search = search_label_opt(optarg);
			break;
-
		case 's':	/* Same as -M size */
+
		case 's':	/* Same as -Q size */
			opt |= modifier_opt("size");
			break;
		case 'x':