I agree. Sadly, there's no way for me to detect the list of accepted commands in a more sane way. I've changed it slightly to use zfs -? (which returns a 0 exit code) instead of zfs (which returns non-zero), so I'm not depending on a failure condition to find the upgrade command, but other than that, the only other way I could think of is to run the upgrade command and check for the error status, but that means also depending on a failure condition. Any suggestions?