pisi search-file -q hede sadece paket adını döndürsün
This commit is contained in:
@@ -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,6 +1370,9 @@ 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:
|
||||||
|
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))
|
ctx.ui.info(_("Package %s has file %s") % (pkg_name, file_info.path))
|
||||||
if ctx.config.options.long:
|
if ctx.config.options.long:
|
||||||
ctx.ui.info(_('Type: %s, Hash: %s') % (file_info.type,
|
ctx.ui.info(_('Type: %s, Hash: %s') % (file_info.type,
|
||||||
@@ -1384,6 +1390,7 @@ 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:
|
||||||
|
if not ctx.config.options.quiet:
|
||||||
ctx.ui.info(_('Searching for %s') % path)
|
ctx.ui.info(_('Searching for %s') % path)
|
||||||
import os.path
|
import os.path
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
|
|||||||
Reference in New Issue
Block a user