Only output version if no tasks were specified

This is less "greedy" and allows tasks to make use of the `--version` argument.
@sindresorhus I was trying to sort-of match the syntax of the check on L39 but I'll make this change.