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=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15967 invoked from network); 12 Apr 2021 02:53:08 -0000 Received: from 1ess.inri.net (216.126.196.35) by inbox.vuxu.org with ESMTPUTF8; 12 Apr 2021 02:53:08 -0000 Received: from wopr.sciops.net ([216.126.196.60]) by 1ess; Sun Apr 11 20:06:02 -0400 2021 Received: (qmail 16475 invoked from network); 11 Apr 2021 17:05:53 -0700 Received: from 100.43.142.88.rev.sfr.net (HELO aib.nope) (qwx@88.142.43.100) by wopr.sciops.net with SMTP; 11 Apr 2021 17:05:53 -0700 Message-ID: <0B6D3C32FB0256660217BF6D3E67167F@wopr.sciops.net> From: qwx Date: Mon, 12 Apr 2021 02:05:51 +0200 To: 9front@9front.org MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: managed converged WEB2.0 over ORM realtime-java out-scaling framework Subject: [9front] crop: allow no-ops in pipelines Reply-To: 9front@9front.org Precedence: bulk Hello, Any objections to pushing this change? Thanks, qwx -- crop: allow no-ops in pipelines unlike other tools like iconv(1), a crop(1) without arguments or with ones resulting in a no-op, like `-t 0 0', errors out. other options like `-i 0' do not error. this breaks assumptions and results in tedious intermediary steps or hacks like: foo | {crop -t $1 $2 >[2]/null || cat} > baz.bit instead, just ignore the check. subsequent code doesn't make assumptions on it. diff -r 936eda80a52f sys/src/cmd/crop.c --- a/sys/src/cmd/crop.c Sat Apr 10 15:01:09 2021 +0200 +++ b/sys/src/cmd/crop.c Mon Apr 12 02:01:12 2021 +0200 @@ -148,9 +148,6 @@ usage(); }ARGEND - if(mode == None && cropval == 0 && eqpt(ZP, t)) - usage(); - file = ""; fd = 0; if(argc > 1)