merge profpatschs cmd-flag code