pisi search-file -q hede sadece paket adını döndürsün
This commit is contained in:
+11
-4
@@ -1351,6 +1351,9 @@ Finds the installed package which contains the specified file.
|
|||||||
default=False, help=_("show in long format"))
|
default=False, help=_("show in long format"))
|
||||||
self.parser.add_option("-f", "--fuzzy", action="store_true",
|
self.parser.add_option("-f", "--fuzzy", action="store_true",
|
||||||
default=False, help=_("fuzzy search"))
|
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
|
# what does exact mean? -- exa
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@@ -1367,9 +1370,12 @@ Finds the installed package which contains the specified file.
|
|||||||
|
|
||||||
if files:
|
if files:
|
||||||
for (pkg_name, file_info) in 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.quiet:
|
||||||
if ctx.config.options.long:
|
ctx.ui.info(_("%s") % (pkg_name))
|
||||||
ctx.ui.info(_('Type: %s, Hash: %s') % (file_info.type,
|
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))
|
file_info.hash))
|
||||||
else:
|
else:
|
||||||
ctx.ui.error(_("Path '%s' does not belong to an installed package") % path)
|
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
|
# search among existing files
|
||||||
for path in self.args:
|
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
|
import os.path
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
path = os.path.realpath(path)
|
path = os.path.realpath(path)
|
||||||
|
|||||||
Reference in New Issue
Block a user