def __init__(self, device, cmdline_file):
    """Initializes the FlagChanger and records the original arguments.

    Args:
      device: A DeviceUtils instance.
      cmdline_file: Path to the command line file on the device.
    """
    self._device = device
    self._cmdline_file = cmdline_file

    # Save the original flags.
    try:
      self._orig_line = self._device.ReadFile(self._cmdline_file).strip()
    except device_errors.CommandFailedError:
      self._orig_line = ''

    # Parse out the flags into a list to facilitate adding and removing flags.
    self._current_flags = self._TokenizeFlags(self._orig_line)