ref_line <- match.arg(ref_line)
the first entry of the default values in the function argument is always used used as the default when a user does not specify anything. There is no need for the complications of the if statement or the use of several.ok = FALSE because that is the default behavior of match.arg().
See the below example of calling optim in R where they also use match.arg()

https://github.com/nmfs-ost/satf/blob/1641eba94dc762663725213503d450f984bec846/R/plot_spawning_biomass.R#L30-L34
should be
the first entry of the default values in the function argument is always used used as the default when a user does not specify anything. There is no need for the complications of the if statement or the use of

several.ok = FALSEbecause that is the default behavior ofmatch.arg().See the below example of calling
optimin R where they also usematch.arg()