Implement --cycle-detect flag, allowing the user to define the number of repeated actions to be considered a cycle