Skip to content

Commit

Permalink
Sort old data by distance when showing --near
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Mar 29, 2015
1 parent 12785dd commit 12dba70
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions commands/olddata_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ def render(results, cmdenv, tdb):
heading, underline = rowFmt.heading()
print(heading, underline, sep='\n')

if cmdenv.near:
results.rows.sort(key=lambda row: row.dist)

for row in results.rows:
print(rowFmt.format(row))

0 comments on commit 12dba70

Please sign in to comment.