From owner-svn-src-all@freebsd.org Sat Aug 18 12:13:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A08B1106B000; Sat, 18 Aug 2018 12:13:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4896A8FBD9; Sat, 18 Aug 2018 12:13:58 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id D2644F825; Sat, 18 Aug 2018 12:13:57 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf1-f47.google.com with SMTP id v22-v6so7704679lfe.8; Sat, 18 Aug 2018 05:13:57 -0700 (PDT) X-Gm-Message-State: AOUpUlHkJG1EmyqUj6cvk1IdpC6RwKLVQj0kBg7xBjLn/ECjz+23YOB2 mqsIyPXBU1uOvKs9kc0YSHiq9G3JlZ0bsS9L/g4= X-Google-Smtp-Source: AA+uWPxreZJ+IMVdWstxpnWGngiW5bLLuJPzwQ5cY6uEMbk09oxGDiwvaCg4LYNyf7TH1HPE75WFr1/sr1XuyJjKr54= X-Received: by 2002:a19:ea52:: with SMTP id i79-v6mr125806lfh.75.1534594436243; Sat, 18 Aug 2018 05:13:56 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5742:0:0:0:0:0 with HTTP; Sat, 18 Aug 2018 05:13:35 -0700 (PDT) In-Reply-To: <201808180535.w7I5ZfsS062952@pdx.rh.CN85.dnsmgr.net> References: <201808171549.w7HFndsp059932@pdx.rh.CN85.dnsmgr.net> <201808180535.w7I5ZfsS062952@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Sat, 18 Aug 2018 07:13:35 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337956 - in head: . bin/ls To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 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: Sat, 18 Aug 2018 12:13:58 -0000 On Sat, Aug 18, 2018 at 12:35 AM, Rodney W. Grimes wrote: >> > On Fri, Aug 17, 2018 at 10:26 AM, Kyle Evans wrote: >> > > On Fri, Aug 17, 2018 at 10:24 AM, Rodney W. Grimes >> > > wrote: >> > >>> Author: kevans >> > >>> Date: Fri Aug 17 04:15:51 2018 >> > >>> New Revision: 337956 >> > >>> URL: https://svnweb.freebsd.org/changeset/base/337956 >> > >>> >> > >>> Log: >> > >>> ls(1): Add --color=when >> > >>> >> > >>> --color may be set to one of: 'auto', 'always', and 'never'. >> > >>> >> > >>> 'auto' is the default behavior- output colors only if -G or COLORTERM are >> > >> >> > >> Why different than coreutils ls? Default for coreutils is none. >> > > >> > > I guess this was worded poorly and you skipped both the review and >> > > reading the diff... this is still contingent on environment variables >> > > or -G being specified. >> > > >> > >>> set, and only if stdout is a tty. >> > >>> >> > >>> 'always' is a new behavior- output colors always. termcap(5) will be >> > >>> consulted unless TERM is unset or not a recognized terminal, in which case >> > >>> ls(1) will fall back to explicitly outputting ANSI escape sequences. >> > >>> >> > >>> 'never' to turn off any environment variable and -G usage. >> > >> Why different than core utils? Coreutils uses none. >> > > >> > > I guess this was worded poorly and you skipped both the review and >> > > reading the diff... this is still contingent on environment variables >> > > or -G being specified. >> > > >> > >> > ... copy-paste-o. The version of coreutils ls(1) that I have uses >> > 'never' for this. There is no valid 'none' value. >> >> Oh boy, we need to investiage that then, cause it seems >> as if the official page says none. Does your say it >> has a different default value too? > > And our package of gnu coreutils also says never, so ignore my > raising the issue of none vs never, that needs to be raised > with the gnu folks as it seems as if there online manual and > the code is in conflict. Ooopss.. retract that here we go... > I have our pkg coreutils installed: This is what I was afraid of. =( > root@x230a:~ # gls --color=none > 828phone.tgz Desktop Downloads firefox.core soffice.bin.core > root@x230a:~ # gls --color=never > 828phone.tgz Desktop Downloads firefox.core soffice.bin.core > root@x230a:~ # gls --color=theychangedit > gls: invalid argument 'theychangedit' for '--color' > Valid arguments are: > - 'always', 'yes', 'force' > - 'never', 'no', 'none' > - 'auto', 'tty', 'if-tty' > Try 'gls --help' for more information. Except that's even worse than I thought... I assumed it was "always"; "never", "none"; "auto" having kept both "never" and "none" for backwards compat. =\ > So it looks as if we need to add a we bit > more to make our use of --color match what > coreutils actually allows. > > *Runs and ducks* cause Kyle has already gone way above > the call of duty on this one! More than happy to add all of these aliases so that we do the right thing if the user is explicit. =) I generally just don't want to change the default behavior away from respecting the environment/-G since we've done this for so long now. I believe in compatibility with GNU tools so that user doesn't get surprised when an option they want doesn't exist (see: the various long options commits I've made in the past), but I believe a lot less in bending how we do things by default to match when we already have our own precedent set. Thanks, Kyle Evans