Pass command state in a command_state structure instead of adding more arguments to command handlers.