From owner-freebsd-hackers@freebsd.org Fri May 29 18:42:34 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA0F333EB57 for ; Fri, 29 May 2020 18:42:34 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49YYMt222Sz4DR5; Fri, 29 May 2020 18:42:33 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 04TIgPcK099580; Fri, 29 May 2020 11:42:25 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04TIgPJC099579; Fri, 29 May 2020 11:42:25 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <202005291842.04TIgPJC099579@gndrsh.dnsmgr.net> Subject: Re: Introduce ifconfig -a -g groupname In-Reply-To: <1bb658e41c849e9ea2c623ffdc70b0b934d4053d.camel@freebsd.org> To: Ian Lepore Date: Fri, 29 May 2020 11:42:25 -0700 (PDT) CC: Eugene Grosbein , Freebsd hackers list X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49YYMt222Sz4DR5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; REPLY(-4.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2020 18:42:35 -0000 > On Fri, 2020-05-29 at 19:57 +0700, Eugene Grosbein wrote: > > Hi! > > > > Currently "ifconfig -a" command that shows status of network > > interfaces > > may be combined with flags -d or -u to limit the list to interfaces > > that are down or up. > > > > The change https://reviews.freebsd.org/D25029 allows it to filter the > > list > > by name of interface group with additional flag -g groupname, or -g > > ^groupname to negate condition > > (this is different from "ifconfig -g groupname" that shows interface > > names only > > and that behaviour is not affected with the change). > > > > I chose caret symbol (^) was choosen to ease both scripted and > > interactive usage > > so it does not require extra quotation/escaping, but was told > > that caret would require escaping in the zsh. > > > > So I ask for suggestions which symbol to choose instead of caret. > > Benedict Reuschling suggested @ and I'm fine with it > > if we don't care about Perl code that would require escaping it when > > running shell code. > > > > For thouse who interested, these are supposed usage examples: > > > > to exclude loopback from the list: > > ifconfig -a -g ^lo > > to show vlan interfaces only: > > ifconfig -a -g vlan > > to show tap interfaces that are up: > > ifconfig -aug tap > > > > An @ to express negation is insane. The only characters that have some > precedent for meaning negation are ~ and !. And perhaps the original ^, for me anyway. > Escaping is a fact of life, asking people to remember crazy things like > @ meaning not is far more onerous than occasionally needing to put > quotes or escapes on something. Agree with that fully. I actually do not like special tokens in arguments to options, and prefer the suggested use of a different option for exclude, as in -G vlan to exclude gruop vlan. I can not think of a command of the top of my head that does exclusion by special token in option argument and can think of many with --include --exclude type options. > -- Ian -- Rod Grimes rgrimes@freebsd.org