implement '@when' docblock tag

Works on both commands and subcommands.