

There is a lot of evidence that this type of punishment is counter productive and leads to more problems than it solves. EG https://healthy.kaiserpermanente.org/health-wellness/health-encyclopedia/he.corporal-punishment.tm4923
Maybe you can show her those things and point out that those behaviors do not create healthy relationships. If she agrees with him, maybe her relationship is also not healthy, and should be limited.
set -x
configures the running process, your shell. This is a posix standard flag. See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.htmlWhy do think this? I’m not aware of any shells that have such a feature. I’m not saying it couldn’t be done, but it would be a new feature.
I like the other suggestion of having a wrapper script that does what you need.