summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/delete/main.c
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/delete/main.c
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/delete/main.c')
-rw-r--r--usr.sbin/pkg_install/delete/main.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/usr.sbin/pkg_install/delete/main.c b/usr.sbin/pkg_install/delete/main.c
index 6bf0762..6075f72 100644
--- a/usr.sbin/pkg_install/delete/main.c
+++ b/usr.sbin/pkg_install/delete/main.c
@@ -24,12 +24,12 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/stat.h>
+#include <getopt.h>
#include <err.h>
+
#include "lib.h"
#include "delete.h"
-static char Options[] = "adDfGhinp:rvxX";
-
char *Prefix = NULL;
Boolean CleanDirs = FALSE;
Boolean Interactive = FALSE;
@@ -39,6 +39,25 @@ match_t MatchType = MATCH_GLOB;
static void usage(void);
+static char opts[] = "adDfGhinp:rvxX";
+static struct option longopts[] = {
+ { "all", no_argument, NULL, 'a' },
+ { "clean-dirs", no_argument, NULL, 'd' },
+ { "dry-run", no_argument, NULL, 'n' },
+ { "extended", no_argument, NULL, 'X' },
+ { "force", no_argument, NULL, 'f' },
+ { "help", no_argument, NULL, 'h' },
+ { "interactive",no_argument, NULL, 'i' },
+ { "prefix", required_argument, NULL, 'p' },
+ { "recursive", no_argument, NULL, 'r' },
+ { "regex", no_argument, NULL, 'x' },
+ { "no-glob", no_argument, NULL, 'G' },
+ { "no-script", no_argument, NULL, 'D' },
+ { "no-scripts", no_argument, NULL, 'D' },
+ { "verbose", no_argument, NULL, 'v' },
+ { NULL, 0, NULL, 0 },
+};
+
int
main(int argc, char **argv)
{
@@ -49,7 +68,7 @@ main(int argc, char **argv)
struct stat stat_s;
pkgs = start = argv;
- while ((ch = getopt(argc, argv, Options)) != -1)
+ while ((ch = getopt_long(argc, argv, opts, longopts, NULL)) != -1)
switch(ch) {
case 'v':
Verbose++;
@@ -101,7 +120,6 @@ main(int argc, char **argv)
break;
case 'h':
- case '?':
default:
usage();
break;
OpenPOWER on IntegriCloud