[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: command -v in postinsts violating policy



Hi Adam,

> If there is an existing command out there, called '-q', and we suddenly add a
> '-q' option to which, then the old behaviour of which will be broken.
> 
> Previously, you only needed to do 'which -q' to find this program.

This does not work with current which:
$ which -q
/usr/bin/which: type: illegal option: -q
type: usage: type [-apt] name [name ...]

I tried on macOS X it works only if `-q' is executeble, and if you use
`which -- -q', it try to check for the existence of `--' (macOS X is the only
other unix i've access to).

OTOH, even `command -v' can fail with a `-p' command in /usr/bin.
To test for the existence of `-p' command you have to call `command -v -- -p'

So, now?
I think that the right behaviour is that of the Debian's which, and adding a
flag -q will be of no harm.

I may be wrong, tell me.

ciao,
-- 
Luca - De Whiskey's - De Vitis              | Elegant or ugly code as well
aliases: Luca ^De [A-Z][A-Za-z\-]*[iy]'\?s$ | as fine or rude sentences have
Luca, a wannabe ``Good guy''.               | something in common: they
local LANG="it_IT@euro"                     | don't depend on the language.


-- 
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: