authorgravatar for mtlynch@users.noreply.github.comMichael Lynch <mtlynch@users.noreply.github.com> 2025-02-13 16:06:10-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-02-13 13:06:10-08:00
logcb5547e3dece175aa372dbfa26e6e9663cdf1c17
treeb435e7d6e3cc0ca529182300c682d729029df092
parentbffbc918ee2b349923ca2e7b9b5c8ff8fa1d0cd0
signaturebadge-check Signed by PGP key B5690EEEBB952194

Expand zig fetch usage help doc to explain URL (#22850)

The current zig fetch help docs tell the user to specify a package's URL, but it's unclear what the URL should be. This change expands the help output to explain what URLs the zig fetch command can handle and provides examples of valid URLs. Related: #20096 A git bundle file seems to be the more accurate term, as it's what git uses in its documentation: https://git-scm.com/docs/git-bundle

1 files changed, 10 insertions(+), 0 deletions(-)

src/main.zig+10
......@@ -6956,6 +6956,16 @@ const usage_fetch =
69566956 \\Usage: zig fetch [options] <path>
69576957 \\
69586958 \\ Copy a package into the global cache and print its hash.
6959 \\ <url> must point to one of the following:
6960 \\ - A git+http / git+https server for the package
6961 \\ - A tarball file (with or without compression) containing
6962 \\ package source
6963 \\ - A git bundle file containing package source
6964 \\
6965 \\Examples:
6966 \\
6967 \\ zig fetch --save git+https://example.com/andrewrk/fun-example-tool.git
6968 \\ zig fetch --save https://example.com/andrewrk/fun-example-tool/archive/refs/heads/master.tar.gz
69596969 \\
69606970 \\Options:
69616971 \\ -h, --help Print this help and exit