summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/info
diff options
context:
space:
mode:
authorflz <flz@FreeBSD.org>2008-05-30 14:26:09 +0000
committerflz <flz@FreeBSD.org>2008-05-30 14:26:09 +0000
commit9a2047ba483ae2319d063ec4bd72a70e706bd7c1 (patch)
tree879a8bde309ee78659bbc86a35be8b5b8cb6071b /usr.sbin/pkg_install/info
parentabbda8507b5aecb2e8c4a237e56eb32f4b2d1308 (diff)
downloadFreeBSD-src-9a2047ba483ae2319d063ec4bd72a70e706bd7c1.zip
FreeBSD-src-9a2047ba483ae2319d063ec4bd72a70e706bd7c1.tar.gz
- Add long options to pkg_install.
- Remove check for '-?' as it's not listed in authorized options. - Bump PKG_INSTALL_VERSION to 20080530.
Diffstat (limited to 'usr.sbin/pkg_install/info')
-rw-r--r--usr.sbin/pkg_install/info/main.c28
-rw-r--r--usr.sbin/pkg_install/info/pkg_info.132
2 files changed, 40 insertions, 20 deletions
diff --git a/usr.sbin/pkg_install/info/main.c b/usr.sbin/pkg_install/info/main.c
index 64c7995..aaa2a1b 100644
--- a/usr.sbin/pkg_install/info/main.c
+++ b/usr.sbin/pkg_install/info/main.c
@@ -22,11 +22,11 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "lib.h"
-#include "info.h"
+#include <getopt.h>
#include <err.h>
-static char Options[] = "abcdDe:EfgGhiIjkKl:LmoO:pPqQrRst:vVW:xX";
+#include "lib.h"
+#include "info.h"
int Flags = 0;
match_t MatchType = MATCH_GLOB;
@@ -41,6 +41,25 @@ struct which_head *whead;
static void usage(void);
+static char opts[] = "abcdDe:EfgGhiIjkKl:LmoO:pPqQrRst:vVW:xX";
+static struct option longopts[] = {
+ { "all", no_argument, NULL, 'a' },
+ { "blocksize", no_argument, NULL, 'b' },
+ { "exist", required_argument, NULL, 'X' },
+ { "exists", required_argument, NULL, 'X' },
+ { "extended", no_argument, NULL, 'e' },
+ { "help", no_argument, NULL, 'h' },
+ { "keep", no_argument, NULL, 'K' },
+ { "no-glob", no_argument, NULL, 'G' },
+ { "origin", required_argument, NULL, 'O' },
+ { "quiet", no_argument, NULL, 'q' },
+ { "regex", no_argument, NULL, 'x' },
+ { "template", required_argument, NULL, 't' },
+ { "verbose", no_argument, NULL, 'v' },
+ { "version", no_argument, NULL, 'P' },
+ { "which", required_argument, NULL, 'W' },
+};
+
int
main(int argc, char **argv)
{
@@ -58,7 +77,7 @@ main(int argc, char **argv)
MatchType = MATCH_ALL;
Flags = SHOW_INDEX;
}
- else while ((ch = getopt(argc, argv, Options)) != -1) {
+ else while ((ch = getopt_long(argc, argv, opts, longopts, NULL)) != -1) {
switch(ch) {
case 'a':
MatchType = MATCH_ALL;
@@ -209,7 +228,6 @@ main(int argc, char **argv)
break;
case 'h':
- case '?':
default:
usage();
break;
diff --git a/usr.sbin/pkg_install/info/pkg_info.1 b/usr.sbin/pkg_install/info/pkg_info.1
index 17c0bba..8b032c1 100644
--- a/usr.sbin/pkg_install/info/pkg_info.1
+++ b/usr.sbin/pkg_install/info/pkg_info.1
@@ -17,7 +17,7 @@
.\" @(#)pkg_info.1
.\" $FreeBSD$
.\"
-.Dd January 9, 2006
+.Dd May 30, 2008
.Dt PKG_INFO 1
.Os
.Sh NAME
@@ -25,7 +25,7 @@
.Nd a utility for displaying information on software packages
.Sh SYNOPSIS
.Nm
-.Op Fl bcdDEfgGiIjkKLmopPqQrRsvVxX
+.Op Fl bcdDEfghGiIjkKLmopPqQrRsvVxX
.Op Fl e Ar package
.Op Fl l Ar prefix
.Op Fl t Ar template
@@ -67,9 +67,9 @@ For example,
will match versions 20030723 and later of the
.Pa portupgrade
package.
-.It Fl a
+.It Fl a , -all
Show all currently installed packages.
-.It Fl b
+.It Fl b , -blocksize
Use the
.Ev BLOCKSIZE
environment variable for output even when the
@@ -77,11 +77,13 @@ environment variable for output even when the
or
.Fl Q
flag is present.
-.It Fl v
+.It Fl h , -help
+Print help message.
+.It Fl v , -verbose
Turn on verbose output.
.It Fl p
Show the installation prefix for each package.
-.It Fl q
+.It Fl q , -quiet
Be
.Dq quiet
in emitting report headers and such, just dump the
@@ -110,7 +112,7 @@ precedence over all other package formatting options.
Show the requirements script (if any) for each package.
.It Fl k
Show the de-install script (if any) for each package.
-.It Fl K
+.It Fl K , -keep
Keep any downloaded package in
.Ev PKGDIR
if it is defined or in current directory by default.
@@ -139,14 +141,14 @@ This path is the directory name in the
.Fx
.Em "Ports Collection"
of the underlying port from which the package was generated.
-.It Fl G
+.It Fl G , -no-glob
Do not try to expand shell glob patterns in the
.Ar pkg-name
when selecting packages to be displayed (by default
.Nm
automatically expands shell glob patterns in the
.Ar pkg-name ) .
-.It Fl W Ar filename
+.It Fl W , -which Ar filename
For the specified
.Ar filename
argument show which package it belongs to.
@@ -156,10 +158,10 @@ directories specified in the environment variable
.Ev PATH
are searched using
.Xr which 1 .
-.It Fl O Ar origin
+.It Fl O , -origin Ar origin
List all packages having the specified
.Ar origin .
-.It Fl x
+.It Fl x , -regex
Treat the
.Ar pkg-name
as a regular expression and display information only for packages
@@ -169,13 +171,13 @@ expressions could be provided, in that case
.Nm
displays information about all packages that match at least one
regular expression from the list.
-.It Fl X
+.It Fl X , -extended
Like
.Fl x ,
but treats the
.Ar pkg-name
as an extended regular expression.
-.It Fl e Ar package
+.It Fl e , -exists Ar package
If the package identified by
.Ar package
is currently installed, return 0, otherwise return 1.
@@ -198,7 +200,7 @@ necessarily want the output intermingled in such a way that they cannot
organize it.
This lets you add a special token to the start of
each field.
-.It Fl t Ar template
+.It Fl t , -template Ar template
Use
.Ar template
as the argument to
@@ -226,7 +228,7 @@ indeed to overflow it.
.Ed
.It Fl V
Show revision number of the packing list format.
-.It Fl P
+.It Fl P , -version
Show revision number of package tools.
.El
.Sh TECHNICAL DETAILS
OpenPOWER on IntegriCloud