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.0 required=5.0 tests=RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10042 invoked from network); 18 Dec 2020 04:13:20 -0000 Received: from ewsd.inri.net (107.191.116.128) by inbox.vuxu.org with ESMTPUTF8; 18 Dec 2020 04:13:20 -0000 Received: from icebubble.org ([174.136.103.210]) by ewsd; Thu Dec 17 23:06:59 -0500 2020 Received: from petunia by icebubble.org with local-bsmtp (Exim 4.76) (envelope-from ) id 1kq77m-00010g-Fe for 9front@9front.org; Fri, 18 Dec 2020 04:12:14 +0000 Received: from rusat by cmarib.ramside with local (Exim 4.72) (envelope-from ) id 1kq5ST-0005Od-Hy for 9front@9front.org; Fri, 18 Dec 2020 02:25:29 +0000 From: magma698hfsp273p9f@icebubble.org To: 9front@9front.org References: <5bae97d5-c808-7faf-c0f3-2dfcdfabbfa1@typed-hole.org> Date: Fri, 18 Dec 2020 02:25:29 +0000 In-Reply-To: <5bae97d5-c808-7faf-c0f3-2dfcdfabbfa1@typed-hole.org> (Julien Blanchard's message of "Tue, 15 Dec 2020 19:02:29 +0100") Message-ID: <86lfdvvoiu.fsf@cmarib.ramside> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: core grid full-stack-oriented backend Subject: Re: [9front] [PATCH] Update hpost to use -r header like hget Reply-To: 9front@9front.org Precedence: bulk Julien Blanchard writes: > diff -r ac35c963f8e2 rc/bin/hpost > --- a/rc/bin/hpost Sun Dec 13 20:23:03 2020 +0100 > +++ b/rc/bin/hpost Tue Dec 15 17:45:26 2020 +0000 > @@ -1,12 +1,13 @@ > #!/bin/rc > rfork e > url=() > +header=() > at=() # text fields > af=() # file fields > l=() > > fn usage { > - echo 'usage: hpost [ -l ] [ -[gpm] action ] [ -u ] url [ > field:value | field@file ... ]' >[1=2] > + echo 'usage: hpost [ -l ] [ -[gpm] action ] [ -r ] header [ -u > ] url [ field:value | field@file ... ]' >[1=2] I think that should be: [ -r header ] ... rather than: [ -r ] header > exit usage > } > > @@ -14,6 +15,7 @@ > switch($1){ > case -l; l=($l $1) > case -u; shift; url=$1 > + case -r; shift; header=$1 > case -g; shift; action=$1; method=mget > case -p; shift; action=$1; method=mpost > case -m; shift; action=$1; method=multi > @@ -95,7 +97,10 @@ > } > > if(! ~ $action ''){ > - hget=(hget $l) > + if(~ $header '') > + hget=(hget $l) > + if not > + hget=(hget -r $header $l) > $method > exit > }