builtin-remote: split show_or_prune() in two separate functions