From owner-svn-src-all@freebsd.org Thu Oct 29 18:34:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E72F445A3D6; Thu, 29 Oct 2020 18:34:47 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CMYyH5sLhz47rf; Thu, 29 Oct 2020 18:34:47 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC66BA30C; Thu, 29 Oct 2020 18:34:47 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09TIYlJ9040547; Thu, 29 Oct 2020 18:34:47 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09TIYlrb040546; Thu, 29 Oct 2020 18:34:47 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202010291834.09TIYlrb040546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Thu, 29 Oct 2020 18:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367141 - head/usr.bin/fetch X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/fetch X-SVN-Commit-Revision: 367141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Oct 2020 18:34:48 -0000 Author: fernape (ports committer) Date: Thu Oct 29 18:34:47 2020 New Revision: 367141 URL: https://svnweb.freebsd.org/changeset/base/367141 Log: fetch(1): Add EXAMPLES section Add a few examples covering flags: 1, R, a, o, q, r, s, v Approved by: manpages (bcr@) Differential Revision: https://reviews.freebsd.org/D26946 Modified: head/usr.bin/fetch/fetch.1 Modified: head/usr.bin/fetch/fetch.1 ============================================================================== --- head/usr.bin/fetch/fetch.1 Thu Oct 29 18:29:22 2020 (r367140) +++ head/usr.bin/fetch/fetch.1 Thu Oct 29 18:34:47 2020 (r367141) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 6, 2018 +.Dd October 29, 2020 .Dt FETCH 1 .Os .Sh NAME @@ -384,6 +384,51 @@ If the argument is used and the remote file is not newer than the specified file then the command will still return success, although no file is transferred. +.Sh EXAMPLES +Silently try to fetch the URLs passed as parameters. +The first one will fail. +If the second URL succeeds the third one will not be tried: +.Bd -literal -offset indent +$ fetch -1 -q https://www.freebsd.org/bad.html \\ + ftp.freebsd.org/pub/FreeBSD/README.TXT \\ + https://www.fake.url +fetch: https://www.freebsd.org/bad.html: Not Found +.Ed +.Pp +Be verbose when retrieving the +.Ql README.TXT +file: +.Bd -literal -offset indent +$ fetch -v ftp.freebsd.org/pub/FreeBSD/README.TXT +resolving server address: ftp.freebsd.org:80 +requesting http://ftp.freebsd.org/pub/FreeBSD/README.TXT +local size / mtime: 4259 / 1431015519 +remote size / mtime: 4259 / 1431015519 +README.TXT 4259 B 44 MBps 00s +.Ed +.Pp +Quietly save the +.Ql README.TXT file as +.Ql myreadme.txt +and do not delete the output file under any circumstances: +.Bd -literal -offset indent +fetch -o myreadme.txt -q -R ftp.freebsd.org/pub/FreeBSD/README.TXT +.Ed +.Pp +Print the size of the requested file and identify the request with a custom user +agent string: +.Bd -literal -offset indent +$ fetch -s ftp.freebsd.org/pub/FreeBSD/README.TXT +--user-agent="Mozilla/5.0 (X11; FreeBSD x86_64; rv:78.0) Gecko/20100101" +3513231 +.Ed +.Pp +Restart the transfer of the +.Ql README.TXT +file and retry the transfer upon soft failures: +.Bd -literal -offset indent +$ fetch -a -r http://ftp.freebsd.org/pub/FreeBSD/README.TXT +.Ed .Sh SEE ALSO .Xr fetch 3 , .Xr phttpget 8