Quoth Roland Mainz on Wed, Jun 04, 2008 at 11:23:33PM +0200:
> David Bustos wrote:
> > Quoth Nicolas Williams on Wed, Jun 04, 2008 at 12:52:43PM -0500:
> > > My simple proposal would be used as I described:
> [snip]
> > Those output modes seem designed for dumping all of the property groups
> > of a service or instance.  Somehow, I don't think that would be common.
> 
> What would you need (or beter: What do you think would be a common
> usage) ?

I think the most common usage is to retrieve a single value from
a particular property, and if the property is of the wrong type or
doesn't have a single value (no values or more than one), consider it an
error.  This is covered by 6419671 "svcprop -1 & -T".

Next would be to iterate over all the values of a particular property.
This was the original goal of svcprop's output format, which is why it
quotes all shell metacharacters within each value and separates the
values by spaces.  Apparently, though, this doesn't work.  I think most
developers would also want svcprop to fail if the property was of a type
different than expected, which could be done with the -T in the RFE
above.

Then there are developers who create property groups to represent
separate objects.  They would want to iterate over all property groups
in the running snapshot of a service instance, probably filtered by
property group type.  Then they'd want to access particular properties
of each property group.  Though if they want this to be robust against
modification, then they'd have to use libscf anyway, so it's not clear
to me we should facilitate this in svcprop.

And finally there might be developers who create variable numbers of
properties in a particular property group, and they might want to
iterate over them.  This could be done with current svcprop output,
though perhaps not as efficiently as possible.


David

Reply via email to