chore: change use of `map_or` to `map` and `unwrap_or` in cli helper (#10018)
### Description
Refactor to replace `map_or` with `map` and `unwrap_or`. The separation
of these two steps makes it clear in the code that the `unwrap_or` case
is the default, where it was obscured by the density and argument order
of `map_or` before.