aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Ludd <solar@gentoo.org>2006-05-07 18:11:36 +0000
committerNed Ludd <solar@gentoo.org>2006-05-07 18:11:36 +0000
commit4776b575d47f6c648374f063273e0067565fbabe (patch)
tree308a2d6f5989de8c8a0625e83d41fb8abf394e3a
parent- dont try to unlink the vdb when pretend mode is enabled (diff)
downloadportage-utils-4776b575d47f6c648374f063273e0067565fbabe.tar.gz
portage-utils-4776b575d47f6c648374f063273e0067565fbabe.tar.bz2
portage-utils-4776b575d47f6c648374f063273e0067565fbabe.zip
- add -N/--name-only flag to quse
-rw-r--r--man/quse.19
-rw-r--r--quse.c14
2 files changed, 17 insertions, 6 deletions
diff --git a/man/quse.1 b/man/quse.1
index a741ad79..a4bb8f84 100644
--- a/man/quse.1
+++ b/man/quse.1
@@ -1,12 +1,12 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35.
-.TH quse "1" "April 2006" "Gentoo Foundation" "quse"
+.TH quse "1" "May 2006" "Gentoo Foundation" "quse"
.SH NAME
quse \- manual page for quse
.SH SYNOPSIS
.B quse
\fI<useflag> : find pkgs using useflags\fR
.SH DESCRIPTION
-Options: \fB\-[eavKLDF\fR:vqChV]
+Options: \fB\-[eavKLDF\fR:NvqChV]
.TP
\fB\-e\fR, \fB\-\-exact\fR
* Show exact non regexp matching using strcmp
@@ -28,6 +28,9 @@ Options: \fB\-[eavKLDF\fR:vqChV]
.BR
* Use your own variable formats. \fB\-F\fR NAME=
.TP
+\fB\-N\fR, \fB\-\-name\-only\fR
+* Only show package name
+.TP
\fB\-v\fR, \fB\-\-verbose\fR
* Make a lot of noise
.TP
@@ -43,4 +46,4 @@ Options: \fB\-[eavKLDF\fR:vqChV]
\fB\-V\fR, \fB\-\-version\fR
* Print version and exit
.PP
-$Id: quse.1,v 1.14 2006/04/15 21:31:08 solar Exp $
+$Id: quse.1,v 1.15 2006/05/07 18:11:36 solar Exp $
diff --git a/quse.c b/quse.c
index 4d440d53..b703a133 100644
--- a/quse.c
+++ b/quse.c
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/quse.c,v 1.50 2006/03/09 02:44:06 solar Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/quse.c,v 1.51 2006/05/07 18:11:36 solar Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
@@ -14,7 +14,7 @@
quse -Ke -- nls
*/
-#define QUSE_FLAGS "eavKLDF:" COMMON_FLAGS
+#define QUSE_FLAGS "eavKLDF:N" COMMON_FLAGS
static struct option const quse_long_opts[] = {
{"exact", no_argument, NULL, 'e'},
{"all", no_argument, NULL, 'a'},
@@ -22,6 +22,7 @@ static struct option const quse_long_opts[] = {
{"license", no_argument, NULL, 'L'},
{"describe", no_argument, NULL, 'D'},
{"format", a_argument, NULL, 'F'},
+ {"name-only", no_argument, NULL, 'N'},
COMMON_LONG_OPTS
};
static const char *quse_opts_help[] = {
@@ -31,13 +32,16 @@ static const char *quse_opts_help[] = {
"Use the LICENSE vs IUSE",
"Describe the USE flag",
"Use your own variable formats. -F NAME=",
+ "Only show package name",
COMMON_OPTS_HELP
};
-static const char quse_rcsid[] = "$Id: quse.c,v 1.50 2006/03/09 02:44:06 solar Exp $";
+static const char quse_rcsid[] = "$Id: quse.c,v 1.51 2006/05/07 18:11:36 solar Exp $";
#define quse_usage(ret) usage(ret, QUSE_FLAGS, quse_long_opts, quse_opts_help, lookup_applet_idx("quse"))
int quse_describe_flag(int ind, int argc, char **argv);
+char quse_name_only = 0;
+
static void print_highlighted_use_flags(char *string, int ind, int argc, char **argv) {
char *str, *p;
char buf[BUFSIZ];
@@ -45,6 +49,9 @@ static void print_highlighted_use_flags(char *string, int ind, int argc, char **
short highlight = 0;
int i;
+ if (quse_name_only)
+ return;
+
strncpy(buf, string, sizeof(buf));
str = buf;
remove_extra_space(str);
@@ -179,6 +186,7 @@ int quse_main(int argc, char **argv)
case 'L': idx = 2; break;
case 'D': idx = -1; break;
case 'F': idx = 3, search_vars[idx] = xstrdup(optarg); break;
+ case 'N': quse_name_only = 1; break;
COMMON_GETOPTS_CASES(quse)
}
}