From owner-cvs-all@FreeBSD.ORG Tue Jun 3 21:05:50 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 711AB106575B; Tue, 3 Jun 2008 21:05:50 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id 2FEC18FC1D; Tue, 3 Jun 2008 21:05:50 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from [192.168.0.40] ([204.244.149.125]) (authenticated bits=0) by sippysoft.com (8.13.8/8.13.8) with ESMTP id m53L5e7v018954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 3 Jun 2008 14:05:41 -0700 (PDT) (envelope-from sobomax@FreeBSD.org) Message-ID: <4845B220.5000300@FreeBSD.org> Date: Tue, 03 Jun 2008 14:05:36 -0700 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Joe Marcus Clarke References: <200805301426.m4UEQ92d025434@repoman.freebsd.org> <48405C4B.3050603@FreeBSD.org> <1212179252.1967.1.camel@localhost> <33dfad267556d52723e95461f5eb7c34.squirrel@galain.elvandar.org> <48457574.20108@freebsd.org> In-Reply-To: <48457574.20108@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: remko@elvandar.org, Florent Thoumie , cvs-src@FreeBSD.org, cvs-all@FreeBSD.org, src-committers@FreeBSD.org, Coleman Kane Subject: Re: cvs commit: src/usr.sbin/pkg_install/add main.c pkg_add.1 src/usr.sbin/pkg_install/create main.c pkg_create.1 src/usr.sbin/pkg_install/delete main.c pkg_delete.1 src/usr.sbin/pkg_install/info main.c pkg_info.1 ... X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jun 2008 21:05:50 -0000 Joe Marcus Clarke wrote: > Remko Lodder wrote: >> On Tue, June 3, 2008 5:18 pm, Florent Thoumie wrote: >>> On Fri, May 30, 2008 at 9:27 PM, Coleman Kane >>> wrote: >>>> On Fri, 2008-05-30 at 12:58 -0700, Maxim Sobolev wrote: >>>>> I am curious what is our policy on using long options in the base >>>>> system >>>>> (if any)? I believe that pkg_install is the first non-contributed base >>>>> system utility to actually widely use it. For some reason I've got >>>>> impression that use of getopt_long is considered "the Linux/GNU way", >>>>> this API provided for compatibility purposes and its use in base >>>>> system >>>>> is discouraged. Quick grep through /use/src seemingly supports that. >>>>> >>>>> Can someone confirm/reject? >>>> I am not sure about policy, however I do appreciate the long options >>>> sometimes. Primarily, I think they are useful (in a self-documenting >>>> way) for use in shell scripts. I tend to prefer the single-char options >>>> when I am doing the administration myself. >>> I'm not aware of such policy. >>> >>> I think they're useful because as far as pkg_install is concerned, we >>> are using single-char options that are hard to match to the action >>> it's doing. Here are a couple examples: >>> >>> - pkg_create -h doesn't call usage() because it's already taken. >>> - it's easy to confuse pkg_info -o and pkg_info -O. >>> >>> I'll back it out if general consensus is that long options should be >>> avoided. >> I like the change (long opts). > > +1 > > I don't see why we should abandon something that is convenient for our > users just because Linux does it. Apart from the BSD vs. GNU way, I think it's mistake that long "synonyms" have been added to existing options. The reason for that is because this is likely to promote creating superfluously incompatible scripts/software that relies on pkg_install, as developer who develops on say 8.0 may not be aware of the fact that in previous releases those long options were not existing. IMHO, long options is mostly for script writers (for whom it's harmful in this case according to the above). It adds no convenience for a CLI user. Except of maybe one or two options that one uses every day nobody can really remember what world to use without looking into the man page anyway (at which point short option wins since it's easier to type). Maybe I am old school, but for me for example remembering `-L' in wget it much easier than remembering `--relative'. -Maxim