mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-23 11:17:02 -04:00
fix json list output
This commit is contained in:
parent
35aa8c8902
commit
88a37bc552
1 changed files with 2 additions and 1 deletions
|
@ -76,10 +76,11 @@ def main(args=None):
|
||||||
if command.sort:
|
if command.sort:
|
||||||
links = sorted(links, key=lambda link: getattr(link, command.sort))
|
links = sorted(links, key=lambda link: getattr(link, command.sort))
|
||||||
|
|
||||||
|
|
||||||
if command.csv:
|
if command.csv:
|
||||||
print(to_csv(links, csv_cols=command.csv.split(','), header=True))
|
print(to_csv(links, csv_cols=command.csv.split(','), header=True))
|
||||||
elif command.json:
|
elif command.json:
|
||||||
print(to_json(links, indent=4, sort_keys=True))
|
print(to_json(list(links), indent=4, sort_keys=True))
|
||||||
else:
|
else:
|
||||||
print('\n'.join(link.url for link in links))
|
print('\n'.join(link.url for link in links))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue