cmd: fix behavior of DeprecatedCommands for commands with flags

Related to #952.