lord63 / tldr.py

A python client for tldr: simplified and community-driven man pages.
MIT License
186 stars 18 forks source link

tldr find command not working #19

Closed SanketDG closed 8 years ago

SanketDG commented 8 years ago
❯ tldr find tar
Traceback (most recent call last):
  File "/home/sanket/.local/bin//tldr", line 11, in <module>
    sys.exit(cli())
  File "/home/sanket/.local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/sanket/.local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/sanket/.local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/sanket/.local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/sanket/.local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/sanket/.local/lib/python2.7/site-packages/tldr/cli.py", line 99, in find
    output_lines = parse_man_page(command)
  File "/home/sanket/.local/lib/python2.7/site-packages/tldr/cli.py", line 24, in parse_man_page
    page_path = find_page_location(command)
  File "/home/sanket/.local/lib/python2.7/site-packages/tldr/cli.py", line 35, in find_page_location
    encoding='utf-8') as f:
IOError: [Errno 2] No such file or directory: '/home/sanket/tldr/pages/index.json'
lord63 commented 8 years ago

The official tldr repo has removed the index.json. So after you cloned the new fresh repo or when you add some new pages, you should rebuild the index.json via the command:

$ tldr reindex

Does this solve the problem?

SanketDG commented 8 years ago

Cool, this worked and tldr is working as expected. :smile:

I think this should be mentioned in the FAQ for people who started using it early/unaware of the changes.

Closing.