I changed things a bit in the attached patch.
I used 'status=none' rather than 'status=noinfo',
to make it obvious all stderr messages were being suppressed.
Also, I kept the bitmask nature of the existing code
to make it more consistent and extendible.
cheers,
PƔdraig.