From 3d6146489c2d1e69928ad1d75bc9a0c3e6d7df9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Fri, 8 Sep 2006 10:51:26 +0000 Subject: [PATCH] =?UTF-8?q?pisi=20search-file=20-q=20hede=20sadece=20paket?= =?UTF-8?q?=20ad=C4=B1n=C4=B1=20d=C3=B6nd=C3=BCrs=C3=BCn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/cli/commands.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index 25d5c16e..66adc401 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -1351,6 +1351,9 @@ Finds the installed package which contains the specified file. default=False, help=_("show in long format")) self.parser.add_option("-f", "--fuzzy", action="store_true", default=False, help=_("fuzzy search")) + self.parser.add_option("-q", "--quiet", action="store_true", + default=False, help=_("show only package name")) + # what does exact mean? -- exa @staticmethod @@ -1367,9 +1370,12 @@ Finds the installed package which contains the specified file. if files: for (pkg_name, file_info) in files: - ctx.ui.info(_("Package %s has file %s") % (pkg_name, file_info.path)) - if ctx.config.options.long: - ctx.ui.info(_('Type: %s, Hash: %s') % (file_info.type, + if ctx.config.options.quiet: + ctx.ui.info(_("%s") % (pkg_name)) + else: + ctx.ui.info(_("Package %s has file %s") % (pkg_name, file_info.path)) + if ctx.config.options.long: + ctx.ui.info(_('Type: %s, Hash: %s') % (file_info.type, file_info.hash)) else: ctx.ui.error(_("Path '%s' does not belong to an installed package") % path) @@ -1384,7 +1390,8 @@ Finds the installed package which contains the specified file. # search among existing files for path in self.args: - ctx.ui.info(_('Searching for %s') % path) + if not ctx.config.options.quiet: + ctx.ui.info(_('Searching for %s') % path) import os.path if os.path.exists(path): path = os.path.realpath(path)