lord63 / tldr.py

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

Support locate the command man page #11

Closed lord63 closed 8 years ago

lord63 commented 8 years ago

If we want to custom our man pages, we need to find it in the command folder or in the platform folder, a little inconvenient. Maybe we should add a subcommand like this:

$ tldr locate tar
/tldr/repo/pages/linux/tar.md

so we can easily edit the man pages.

Any ideas?

Shir0kamii commented 8 years ago

Maybe add an --edit option that use $EDITOR variable to open the file in the preferred editor of the user ?

lord63 commented 8 years ago

@Shir0kamii If you want to edit your page, you can try this way:

$ tldr locate tar | xargs gedit

In my case, the $EDITOR variable is None, seems like you need to set it.

But you're right, edit the pages should be easy to go.

Currently, I'm for the first implementation, it's simple, easy for test and reliable, you also have more choices for the editors. I haven't made the decision yet, so it's open for discussion :)

Shir0kamii commented 8 years ago

Indeed, I was wrong with this since it's only available on some Linux architectures (Not even all Linux).

But one could set an editor variable in his tldrrc to use the command, isn't it ?

lord63 commented 8 years ago

Yes, we can add another variable to the configuration file and let tldr.py to read it. We'll need to:

Also, users who use the old version of tldr.py need to edit the configuration file. And this may make the initialization a bit complex: too much configuration to set up.

Still prefer the first one.

lord63 commented 8 years ago

Just send a PR to support locate the man page with a few lines of code. If it looks good, a new release will come soon.

Shir0kamii commented 8 years ago

I'll try to do it this night (french hours)

If I commited nothing tomorrow, feel free to make a release, and I'll add this functionnality later.

lord63 commented 8 years ago

@Shir0kamii Thank you for the help :) v0.5.0 support locate the man page via tldr locate {{command}}, close it now.