Fix query cmd opts.Validate
and test func name
#2357
Merged
opts.Validate
and test func name
#2357