Sebastien Roy wrote:
> Some nits on the CLI:
>
> On Mon, 2009-11-16 at 16:54 -0800, Garrett D'Amore wrote:
>   
>>     audioctl list-devices
>>
>>     audioctl show-device [-v] [-d device ]
>>
>>     audioctl show-control [-v] [-d device] [control ...]
>>     
>
> I find it odd that the object specifier for show-device requires an
> option, but that show-control does not.  It seems that all of the
> subcommands operate on a device, so it would be natural to simply
> specify that device as the final (perhaps optional) argument to each
> subcommand (without a -d), and require options for everything else.  For
> example:
>   

I don't agree.  -d <device> will probably not be used for the vast 
majority of cases.  Whereas the control field really does.

The syntax I've proposed is actually the result of me working with the 
existing commands day in and day out, and playing with variants because 
I've been so annoyed at the existing syntax.


>     audioctl list-devices
>
>     audioctl show-device [-v] [device ]
>
>     audioctl show-control [-v] [-c control[,...]] [device]
>
>     audioctl set-control [-v] -c control=value[,...] device
>
>     audioctl save-controls -f file [device]
>
>     audioctl load-controls -f file [device]
>
> The use of plural objects in subcommands is odd to me as well, but
> that's not a big deal.
>   

save-controls and load-controls save *all* controls to the file.

>   
>>     audioctl set-control [-v] [-d device] control value
>>
>>     
>
> What would a -v option print in a set operation?
>   

It shows the effect of the operation, rather than operating silently.

audiots-x86/pepper> ./audioctl set-control -v beep 100
audiohd#0: 'beep' set to '100'

Without the -v, it is silent.

> Also, the syntax proposed seems awkward.  Why not use something more
> common such as is parsed by getsubopt() like (for example):
>
> -c <name>=<value>[,<name>=<value>...]
>   
Again, I've played with it.   The old syntax was "-c <control> -w 
<value>", and didn't use a subcommand.   It was found to be awkward in 
practice.  The new syntax is actually more friendly:

    audioctl set-control volume 50

No special getopt arguments, and the command says exactly what it does.

> Is the device really optional here?
>   

The device really is optional.  If you only have one device (or a 
sensible default), then you don't need to specify which one it applies to.

So while I hear what you're saying about the syntax, I'm disagreeing 
with your suggestions.

    - Garrett


Reply via email to