def ParseFields(selected, default):
  if selected is None:
    return default

  if selected.startswith("+"):
    return default + selected[1:].split(",")

  return selected.split(",")
Parses the values of "--field"-like options.
dataset/ETHPy150Open ganeti/ganeti/lib/cli.py/ParseFields