Skip to content

Commit

Permalink
Merge pull request #1 from msabramo/search-pkg-version
Browse files Browse the repository at this point in the history
Make search name column width dynamic
  • Loading branch information
crodjer committed Dec 22, 2014
2 parents 6203429 + d082e11 commit d69c43b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pip/commands/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ def transform_hits(hits):
return package_list


def print_results(hits, name_column_width=25, terminal_width=None):
def print_results(hits, name_column_width=None, terminal_width=None):
if not hits:
return
if name_column_width is None:
name_column_width = max(
[len(hit['name']) + len(hit.get('versions', ['-'])[-1])
for hit in hits]) + 4
installed_packages = [p.project_name for p in pkg_resources.working_set]
for hit in hits:
name = hit['name']
Expand Down

0 comments on commit d69c43b

Please sign in to comment.