if the command history in cli has consecutive duplicated commands, the duplicates should be removed.