From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id d242a63d for ; Sun, 8 Mar 2020 09:31:43 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id CDE099D78A; Sun, 8 Mar 2020 19:31:41 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id A51879D698; Sun, 8 Mar 2020 19:31:16 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZdwXl1HF"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 935C79D698; Sun, 8 Mar 2020 19:31:13 +1000 (AEST) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by minnie.tuhs.org (Postfix) with ESMTPS id 5CCDB9D649 for ; Sun, 8 Mar 2020 19:31:11 +1000 (AEST) Received: by mail-lf1-f44.google.com with SMTP id i10so5179875lfg.11 for ; Sun, 08 Mar 2020 01:31:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3ssGp02tcFhMMSNdk8igSU03p9UvEc09eVRJc97Ry3A=; b=ZdwXl1HFzOg5e2Gdit11BYWQNBpPnYlExPKK7d+IMzPfWEH1Qzb99cEkXgWLmajxYG 9myf1AukZ6UNLNv/qTlWmrQi0cV+Yihe7Y0XJ009HO35TUyfH90zhiVPaG8DP2KFAYqY J4nKie3KR8TwxCqTS1ZrMkSR9U7A7c0SI+TRCMZ8DuS+KCe72B31I1+iHXQeSPvw5S6t rqg283p8ZeV5E41FlG9AmsbvSLh6VucCI2ylA3an2O+VrQiHWYOM+fj9AmgqpPpWIgnn NgVlMml1n0xbRoUpw5Ckmq2U8oi3W6fVjj6287XduvT4jJhw+xYxUScoCb++QOv88h+p X3UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3ssGp02tcFhMMSNdk8igSU03p9UvEc09eVRJc97Ry3A=; b=VUZ6BYZmjTCd4iBqFTpFvCp/wzqG8RnA5s+SeBwUZHfiP6QQRpHPBb8yivJ+LvTm+9 f1vIeisOGVxkrHMPVIBU2qMnU6YgqYvtfMdff7zZ/MA1eOQH0ELBJaahOvifv7rd8W8U 1FaqZluDO2U5Pxg4fXa6xDWfJdM2ho8VUSELtZdryF8FHv9DzYkQNqo5PF7UpO7BifEc BROySVOAeoL58FXZ8Bi/c3+dGBJpKUwkZIMrZxXQEpc6GQ+9L64swMDROrlIR4Fv4miQ xzqkCdsyCqufmjfiIQd4zNGsRuKIY04CmRJ0Wl0rTGJk6o1q6Ov3Zr9NVj9ZOvMt1YEB 94SA== X-Gm-Message-State: ANhLgQ2ja1GYkdbRKW6RbsIpk/LmDlHQoacVCBfuarDJrPKsFYCf1pV0 n37dPDUd9bt0AjUsivRAQo5QKDeprRLQKpF4CA== X-Google-Smtp-Source: ADFU+vvb9fGykXjAXo/vnavOIgXQT9RdjYpf/wcCLgJ1FV1O2FLsuoAmd6+dksECEdix63ouhV5N5cYR8Sc7/7k6olc= X-Received: by 2002:ac2:5c44:: with SMTP id s4mr3013277lfp.129.1583659869681; Sun, 08 Mar 2020 01:31:09 -0800 (PST) MIME-Version: 1.0 References: <20200305020517.GA13872@wopr> <20200308052632.GD20478@eureka.lemis.com> <202003080532.0285WcWn1544496@darkstar.fourwinds.com> In-Reply-To: <202003080532.0285WcWn1544496@darkstar.fourwinds.com> From: Tyler Adams Date: Sun, 8 Mar 2020 11:30:57 +0200 Message-ID: To: Jon Steinhart Content-Type: multipart/alternative; boundary="000000000000fa3dbd05a0548be2" Subject: Re: [TUHS] Command line options and complexity X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: The Eunuchs Hysterical Society Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --000000000000fa3dbd05a0548be2 Content-Type: text/plain; charset="UTF-8" The idea of a simple rule is great, but the suggested rule fails on sort -u which afaik came after sort | uniq for performance reasons. Another idea on the same vein is that a flag should be added only when the job can be done inside the program and not with stdin/stdout (or no flag can be added if one can reproduce the same behavior using pipelines). So, you need sort -u because only within sort can you get the performance needed to get the job done. But you don't need -h in ls -lh. All the information to render a human readable number is present on stdout of ls -l. You could easily have a filter which renders numbers with options like adding commas, dots, scientific notation, precision, money, units, etc. Tyler On Sun, Mar 8, 2020, 07:33 Jon Steinhart wrote: > After following this discussion, I guess that I have a simplistic way to > determine whether something should be a dash option or a filter. In > general, I'd make a filter if whatever it was doing was applicable to > more than one command, a dash option otherwise. > > Jon > --000000000000fa3dbd05a0548be2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The idea of a simple rule is great, but the suggeste= d rule fails on sort -u which afaik came after sort | uniq for performance = reasons.

Another idea on= the same vein is that a flag should be added only when the job can be done= inside the program and not with stdin/stdout (or no flag can be added if o= ne can reproduce the same behavior using pipelines).

So, you need sort -u because only within s= ort can you get the performance needed to get the job done.

But you don't need -h in ls -lh. = All the information to render a human readable number is present on stdout = of ls -l. You could easily have a filter which renders numbers with options= like adding commas, dots, scientific notation, precision, money, units, et= c.

Tyler

On Sun, Mar 8, 2020, 07:33 Jon Steinhart <jon@fourwinds.com> wrote:
After following this discussion, I guess that I have = a simplistic way to
determine whether something should be a dash option or a filter.=C2=A0 In general, I'd make a filter if whatever it was doing was applicable to more than one command, a dash option otherwise.

Jon
--000000000000fa3dbd05a0548be2--