Current-Users archive

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

Re: Usage/syntax for command-line utilities



On Mon, Mar 18, 2024 at 20:40:57 -0700, Paul Goyette wrote:

> Why do we have drvctl(8) and gpt(8) (for example only, there are
> others) which put the device-to-act-on at the end of the command:
> 
> 	gpt [-Hnqrv] [-m mediasize] [-s sectorsize] [-T timestamp]
> 	    command [command_options] device
> 
> while others such as dkctl(8) and scsictl(8) put the device-to-act-on
> immediately after the utility name:
> 
> 	dkctl device command [arg [...]]
> 	scsictl device command [arg [...]]

Imperative vs object-oriented? :)

    gpt show(wd3)
vs.
    scsictl sd0.debug(2)

Whatever the author of the tool prefers and finds "natural".
ifconfig, e.g., is bit of a mixed bag, b/c stuff after the interface
name is "parameters", but it also has stuff that is clearly commands
in that postition (ifconfig gre0 create, etc).  OO style makes more
sense in places where the commands after the "object" are dependent on
the type of the object.

-uwe


Home | Main Index | Thread Index | Old Index