Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jul 2002 20:42:25 +0200
From:      Jens Schweikhardt <schweikh@schweikhardt.net>
To:        Johan Karlsson <johan@freebsd.org>
Cc:        standards@freebsd.org
Subject:   Re: repeated options to mean different thing
Message-ID:  <20020723204225.A38605@schweikhardt.net>
In-Reply-To: <20020723194802.C50574@numeri.campus.luth.se>
References:  <20020723194802.C50574@numeri.campus.luth.se>

next in thread | previous in thread | raw e-mail | index | archive | help
Johan,

On Tue, Jul 23, 2002 at 07:48:02PM +0200, Johan Karlsson wrote:
# Hi
# 
# In PR 40709 I suggested to use to use -v to mean
# be verbose (current behaivour) and repeated -v 
# (e.g chmod -v -v 777 file, or chmod -vv 777 file) 
# to mean be very verbose.
# 
# tcpdump uses a variant of this where -v mean be verbose
# and -vv mean be even more verbose.
# 
# Sheldon told me to ask here if this goes against POSIX
# or some other standard.
# 
# So, is the use of repeated options prohibited by POSIX?

You can find the gory details in the POSIX Utility Syntax Guidelines,
http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap12.html#tag_12_02

# Or is this a stupid idea from some other standards point of 
# view?

I'd say multiple -v becomes clumsy once you have more than three levels
of verbosity. Why not use -v level or even -v bitmask in cases where you
don't have to be backwards compatible (i.e. if a utility has had -v as a
single letter option it's a bad idea to turn it into an option taking a
level arg. Breaks older scripts.)

Regards,

	Jens
-- 
Jens Schweikhardt http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-standards" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020723204225.A38605>