Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Long options
Matthew Seaman committed 11 years ago
commit 4e4374c51e56cfccfd32c009017ff07844e2ff09
parent f4bb615
1 file changed +10 -3
modified src/shlib.c
@@ -1,5 +1,5 @@
/*-
-
 * Copyright (c) 2012 Matthew Seaman <matthew@FreeBSD.org>
+
 * Copyright (c) 2012-2014 Matthew Seaman <matthew@FreeBSD.org>
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
@@ -27,6 +27,7 @@
#include <sys/param.h>

#include <err.h>
+
#include <getopt.h>
#include <stdio.h>
#include <pkg.h>
#include <libgen.h>
@@ -146,8 +147,14 @@ exec_shlib(int argc, char **argv)
	int		 ch;
	bool		 provides_only = false;
	bool		 requires_only = false;
-

-
	while ((ch = getopt(argc, argv, "PR")) != -1) {
+
	
+
	struct option longopts[] = {
+
		{ "provides",	no_argument,	NULL,	'P' },
+
		{ "requires",	no_argument,	NULL,	'R' },
+
		{ NULL,		0,		NULL,	0 },
+
	};
+

+
	while ((ch = getopt_long(argc, argv, "PR", longopts, NULL)) != -1) {
		switch (ch) {
		case 'P':
			provides_only = true;