It's already supported, the full query just needs to be enclosed in single quotes:

/usr/bin/whois -h whois.pwhois.org 'app="fail2ban:test" type=all 1.2.3.4'
IP: 1.2.3.4
Origin-AS: 15169
Prefix: 1.2.3.0/24
AS-Path: 7018 15169
...