I don’t recall seeing anything like this myself, and I’d be a little surprised if it is common enough of a need for someone to have built in an argument parser and some kind of declaration language for it.
What does foo do if you pass the -u argument twice? If it only respects the first or last option, I guess you could add the default flag in the appropriate location:
I guess it’d be prone to break if they changed the behavior later.