summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/updating
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/updating
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/updating')
-rw-r--r--usr.sbin/pkg_install/updating/main.c15
-rw-r--r--usr.sbin/pkg_install/updating/pkg_updating.116
2 files changed, 23 insertions, 8 deletions
diff --git a/usr.sbin/pkg_install/updating/main.c b/usr.sbin/pkg_install/updating/main.c
index cb594de..238eee3 100644
--- a/usr.sbin/pkg_install/updating/main.c
+++ b/usr.sbin/pkg_install/updating/main.c
@@ -13,6 +13,7 @@ __FBSDID("$FreeBSD$");
#include <errno.h>
#include <limits.h>
#include <sysexits.h>
+#include <getopt.h>
#include "lib.h"
#include "pathnames.h"
@@ -24,6 +25,14 @@ typedef struct installedport {
int usage(void);
+static char opts[] = "d:f:h";
+static struct option longopts[] = {
+ { "date", required_argument, NULL, 'd' },
+ { "file", required_argument, NULL, 'f' },
+ { "help", no_argument, NULL, 'h' },
+ { NULL, 0, NULL, 0 },
+};
+
/*
* Parse /usr/port/UPDATING for corresponding entries. If no argument is
* passed to pkg_updating all entries for all installed ports are displayed.
@@ -74,7 +83,7 @@ main(int argc, char *argv[])
DIR *dir;
FILE *fd;
- while ((ch = getopt(argc, argv, "f:d:")) != -1) {
+ while ((ch = getopt_long(argc, argv, opts, longopts, NULL)) != -1) {
switch (ch) {
case 'd':
dflag = 1;
@@ -83,7 +92,7 @@ main(int argc, char *argv[])
case 'f':
updatingfile = optarg;
break;
- case '?':
+ case 'h':
default:
usage();
}
@@ -247,7 +256,7 @@ int
usage(void)
{
fprintf(stderr,
- "usage: pkg_updating [-d YYYYMMDD] [-f file] [portname ...]\n");
+ "usage: pkg_updating [-h] [-d YYYYMMDD] [-f file] [portname ...]\n");
exit(EX_USAGE);
}
diff --git a/usr.sbin/pkg_install/updating/pkg_updating.1 b/usr.sbin/pkg_install/updating/pkg_updating.1
index 16554b6..e3bcb54 100644
--- a/usr.sbin/pkg_install/updating/pkg_updating.1
+++ b/usr.sbin/pkg_install/updating/pkg_updating.1
@@ -10,7 +10,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 2, 2007
+.Dd May 30, 2008
.Dt PKG_UPDATING 1
.Os
.Sh NAME
@@ -18,6 +18,7 @@
.Nd a utility for displaying UPDATING entries of software packages
.Sh SYNOPSIS
.Nm
+.Op Fl h
.Op Fl d Ar date
.Op Fl f Ar file
.Op Ar pkg-name ...
@@ -32,10 +33,15 @@ The following command line options are supported:
.Bl -tag -width indent
.It Ar pkg-name ...
UPDATING entries for the named packages are displayed.
-.It Fl d Ar date
-Only entries newer than this date are shown. Use a YYYYMMDD date format.
-.It Fl f Ar UPDATING file
-Defines a alternative location of the UPDATING file.
+.It Fl d , -date Ar date
+Only entries newer than
+.Ar date
+are shown. Use a YYYYMMDD date format.
+.It Fl f , -file Ar file
+Defines a alternative location of the UPDATING
+.Ar file .
+.It Fl h , -help
+Print help message.
.El
.Sh EXAMPLES
.Bl -tag -width indent
OpenPOWER on IntegriCloud