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

Add print-only url to rustup doc, fix #1288 #1324

Closed
wants to merge 4 commits into from
Closed

Add print-only url to rustup doc, fix #1288 #1324

wants to merge 4 commits into from

Conversation

amar-laksh
Copy link

Sorry for the earlier one, this is the complete commit.

Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's also a .swp. file and another file 3 that snuck into the PR on accident; could you remove those?

if m.is_present("print-only") {
let path = toolchain.doc_path(doc_url);
match path {
Ok(v) => return Ok(println!("file:/{}", v.to_str().unwrap())),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably wants to be v.display().

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleared the extra files, BTW v.display() for some reason doesn't provide the exact URL. So didn't change that part. Thanks.

@bors
Copy link
Contributor

bors commented Apr 13, 2018

☔ The latest upstream changes (presumably #1390) made this pull request unmergeable. Please resolve the merge conflicts.

if m.is_present("print-only") {
let path = toolchain.doc_path(doc_url);
match path {
Ok(v) => return Ok(println!("file:/{}", v.to_str().unwrap())),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will produce a URL like file:/C:\Foo\bar on windows, or possibly something even stranger, can you update this to work on windows, and also add a test for this command.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll try to work it out.

Copy link
Author

@amar-laksh amar-laksh May 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, shouldn't the URL be just the URL with no platform-specific prefixes?
I mean just the 'C:\Foo\bar' or whatever the platform-specific URL is. @Diggsey ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is probably fine - at least on windows the browser is smart enough to turn a path into a file:/// URL.

@amar-laksh amar-laksh closed this May 28, 2018
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

Successfully merging this pull request may close these issues.

4 participants