From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 4722 invoked from network); 11 Oct 2022 19:12:47 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 11 Oct 2022 19:12:47 -0000 Received: from mx0.riseup.net ([198.252.153.6]) by 9front; Tue Oct 11 15:11:34 -0400 2022 Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx0.riseup.net (Postfix) with ESMTPS id 4Mn5413Xp2z9scL for <9front@9front.org>; Tue, 11 Oct 2022 19:11:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1665515489; bh=caO3b2g9MDpAY9VQr64rJxzBAJmHLMOk7woqL63amdM=; h=To:From:Subject:Date:From; b=Ijg0R5ttRDL+jMfT9ZIK0CQyw6xNmDRIq+kEl+6P3G/kJnvy7fvSExjahXl8ODmCp 4TWHiz2m5MmFr/wZ3HZzHMfUw5N8/QOsCi4HOjG8tTNTPM8ALeD64LUefKPxi/6RRQ NZShzJXMrM05ziz8sKxoHwHdxHfIlhFGiAtArOmQ= X-Riseup-User-ID: 08D7D34E9A225D3DCC9B8BEF625590FF59CC4C9F018D31C6BC64AA223ADE6913 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4Mn53v4xFmz216V for <9front@9front.org>; Tue, 11 Oct 2022 19:11:23 +0000 (UTC) To: 9front@9front.org From: mkf9 Message-ID: Date: Tue, 11 Oct 2022 22:41:20 +0330 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: asynchronous high-performance service standard-oriented replication-oriented interface Subject: [9front] [PATCH] hget: file name detection Reply-To: 9front@9front.org Precedence: bulk This patch adds basic file name detection mode in hget, for example: hget -a http://9front.org/img/nix-on.jpg would be equal to hget -o nix-on.jpg http://9front.org/img/nix-on.jpg --- /bin/hget +++ /bin/hget @@ -2,7 +2,7 @@ rfork e argv0=$0 fn usage { - echo usage: $argv0 '[ -l | -o file] [ -p body | -P ] [ -r header ] [ -m method ] [ -b baseurl ] url' >[1=2] + echo usage: $argv0 '[ -l | -a | -o file] [ -p body | -P ] [ -r header ] [ -m method ] [ -b baseurl ] url' >[1=2] exit usage } s=0 @@ -34,6 +34,8 @@ case -b b=$2 shift + case -a + o=`{basename $2} case * usage }