Add --use-mirror flag support with optional arg

Pretty basic support for `--use-mirror(=n)` as requested in #24424. Defaults to n=1 (first mirror) without an arg value. Ignored given some invalid n, or if there aren't any mirrors. Any suggestions appreciated.