Improve where command.

Allow specifying an EXPAND_USE variable name when searching for a flag. Also allow to optinally searching for an enabled
or disabled state.