Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues on Windows #52

Closed
matteocontrini opened this issue Dec 31, 2015 · 8 comments
Closed

Issues on Windows #52

matteocontrini opened this issue Dec 31, 2015 · 8 comments

Comments

@matteocontrini
Copy link

Hi,
I'm trying to use the client on Windows (10) and I'm having some issues:

1) What should tldr --list show?
My output is Cache last updated [...date...] and then 3 empty lines

2) Why doesn't tldr shutdown work?
The output I get is

Page not found
Try updating with "tldr --update", or submit a pull request to [...]

I've already tried cleaning cache and updating, and in the cache folder (C:\Users\Matteo\.tldr\cache\pages\linux), the shutdown.md file exists.

Other commands like tldr tar work.

@igorshubovych
Copy link
Collaborator

2nd. Because it shows command for your platform, and there is no command on Windows.

To look for command on Windows try:

tldr --os=linux shutdown

If you need to check Linux commands all the time you can put this line in your .tldrrc config JSON file:

{
  "platform": "linux"
}

@matteocontrini
Copy link
Author

@igorshubovych got it. But... why can I do tldr tar for example? There's no such command on Windows. I know, it's in the common directory. But since commands covered by tldr-pages don't work on Windows, shouldn't the default behaviour on Windows be that every platform can be queried?

@agnivade
Copy link
Member

agnivade commented Oct 4, 2016

Hey @matteocontrini - Windows does not have tar natively. But it can be installed with MinGW/MSYS. The common directory will usually hold commands that are platform agnostic. Therefore, the logic to use common directory in Windows.

But commands under linux and osx folders contain platform specific stuff which usually won't work on Windows without "hacks".

Closing this issue now. Please feel free to let me know if you have further questions.

@agnivade agnivade closed this as completed Oct 4, 2016
@waldyrious
Copy link
Member

I think we should (1) consider covering windows commands (see tldr-pages/tldr#1070 (comment)); (2) require every client to either support the --os option, or look in the specific platform directories when one searches for a command that doesn't exist in common. Shall we keep this issue open to track progress in (2), in case we agree on that?

@agnivade
Copy link
Member

agnivade commented Oct 4, 2016

(1) - Totally. Though we need a Windows open-source enthusiast for it 😉

(2) - The behavior of the node client is to look for the command in the platform specific folder first, and if not found, look in the common folder. I think this is the correct logic. In OP's case, shutdown didn't return any results because its in platform specific folders of linux and osx and OP is using Windows.

If you are suggesting that after looking at common, then the platform folder, if nothing is found, the client should look at other folders, I think this will lead to ambiguous behavior. In case, the command exists inside both linux and osx. How to decide which file to render ?

However, I agree that the error message can be improved by saying that "There is no page for your current platform. But the command exists for other platforms, please pass the --os flag to specify the platform of your choice"

@waldyrious
Copy link
Member

Yes, (2) had two options and I agree that the second one you mention (first in my comment above, albeit less detailed) is the one that makes more sense.

@agnivade
Copy link
Member

agnivade commented Oct 4, 2016

Great. I will create a separate issue to track better error messages.

@waldyrious
Copy link
Member

Ok. I've also added --os to the list of client requirements in tldr-pages/tldr#1065.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants