coreutils
coreutils copied to clipboard
Replace deprecated value_of() with get_one()
This PR replaces the usage of clap's deprecated value_of() with get_one().
I tried this myself and got kinda stuck... Unless I'm missing something this API seems very weird. The use case we have most is that we just need some &str and that seems to be impossible because get_one::<T> returns &T and we can't move out of that reference. T can also not be str (without &), because that doesn't implement Clone. So we need to_owned() and cloned() calls all over the place, which defeats the purpose of using &str over String in the first place.
Thanks I am a bit surprised that it is only String as input
I'm sure there are a lot of cases where we can use a more specific value parser instead, but that will require more work to get right.