Move the recent --list=format-tests changes to a new function,
and use it also for --list=format-all-details.