> Just make 'zfs' an alias to your version of it.  A
> one-time edit
> of .profile can update that alias.

Sure; write a shell function, and add an alias to it.
And use a quoted command name (or full path) within the function
to get to the real command.  Been there, done that.
But to do a good job of it means parsing the command line the
same way the real command would, so that it only adds
-o ${ZFS_LIST_PROPS:-name,used,available,referenced,mountpoint} 

or perhaps better

${ZFS_LIST_PROPS:+-o "${ZFS_LIST_PROPS}"}

to zfs list (rather than to other subcommands), and only
if the -o option wasn't given explicitly.

That's not only a bit of a pain, but anytime one is duplicating parsing,
it's begging for trouble: in case they don't really handle it the same,
or in case the underlying command is changed.  And unless that sort of thing
is handled with extreme care (quoting all shell variable references, just
for starters), it can turn out to be a security problem.

And that's just the implicit options part of what I want; the other part would 
take
optionally filtering to modify the command output as well.  That's starting to
get nuts, IMO.

Heck, I can grab a copy of the source for the zfs command, modify it,
and recompile it (without building all of OpenSolaris) faster than I can
write a really good shell wrapper that does the same thing.  But then I
have to maintain my own divergent implementation, unless I can interest
someone else in the idea...OTOH by the time the hoop-jumping for getting
something accepted is over, it's definitely been more bother gain...
-- 
This message posted from opensolaris.org
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to