scripts: make the decoder script more flexible