for-each-ref: fix setup of option-parsing for --sort