Repository navigation
feat(cli): assume a scheme for links that name none, as curl does - #625
Conversation
`ketch example.com/file.zip` failed with "No download source handles this link". As curl and wget, `ketch <url>` and `ketch add` now read a host with a dot, or localhost, followed by a path as http:// (ftp:// for ftp. hosts), which servers may redirect to HTTPS. Links with a scheme, local files such as a .torrent, and bare names stay as they are.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 455e16eaa8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Found while testing CLI input:
curl and wget both accept a link without a scheme, and links copied from text or chat often lack one.
What changes
withAssumedScheme(used byketch <url>andketch add) adds the scheme curl assumes. It applies when the argument is a host holding a dot, orlocalhost, with an optional numeric port and followed by a path:example.com/file.zip,example.com:8080/a,localhost:8765/a.binhttp://…(servers redirect to HTTPS as they do for browsers)ftp.gnu.org/gnu/hello-2.12.tar.gzftp://…https://…,magnet:?…,metalink:…,file:///…my.dir/a.torrent)ubuntu.torrent,downloads/ubuntu.torrent,example.comhost:port/pathisn't mistaken for a scheme: a scheme is followed by//, or holds no dot and no port follows it (magnet:). The CLI'sDownloading:line shows the link with its scheme.Verification
ketchfrom this branch:localhost:8765/file/s.bin(HTTP),ftp.gnu.org/gnu/hello/hello-2.12.tar.gz(FTP) andgithub.com/linroid/Ketch/releases/download/v0.10.1/SHA256SUMS(redirected to HTTPS) all download.DownloadArgsTestcases for the table above, includingparseDownloadArgs../gradlew :cli:test --tests '*DownloadArgsTest*' --tests '*InstanceArgsTest*'passes.