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

Disambiguate URL usage in main binary CLI help message #24360

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

marcospb19
Copy link
Contributor

Addresses #11199's confusion.

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 6, 2025
@marcospb19
Copy link
Contributor Author

Well, I thought this wasn't supposed to support relative files without the file:// prefix, cause it's not working for me, but when I look at the code, it looks like it should:

zed/crates/zed/src/main.rs

Lines 1021 to 1036 in 10792ee

fn parse_url_arg(arg: &str, cx: &App) -> Result<String> {
match std::fs::canonicalize(Path::new(&arg)) {
Ok(path) => Ok(format!("file://{}", path.display())),
Err(error) => {
if arg.starts_with("file://")
|| arg.starts_with("zed-cli://")
|| arg.starts_with("ssh://")
|| parse_zed_link(arg, cx).is_some()
{
Ok(arg.into())
} else {
Err(anyhow!("error parsing path argument: {}", error))
}
}
}
}

Now I'm confused if this not opening relative paths for me is intended or a bug... I need to take another look.

@marcospb19 marcospb19 marked this pull request as draft February 6, 2025 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant