Add --query-installed option