Revision 499eb088

b/lib/cli.py
582 582
    raise errors.ParameterError("Invalid boolean value '%s'" % value)
583 583

  
584 584

  
585
def check_list(option, opt, value): # pylint: disable=W0613
586
  """Custom parser for comma-separated lists.
587

  
588
  """
589
  # we have to make this explicit check since "".split(",") is [""],
590
  # not an empty list :(
591
  if not value:
592
    return []
593
  else:
594
    return utils.UnescapeAndSplit(value)
595

  
596

  
585 597
# completion_suggestion is normally a list. Using numeric values not evaluating
586 598
# to False for dynamic completion.
587 599
(OPT_COMPL_MANY_NODES,
......
615 627
    "keyval",
616 628
    "unit",
617 629
    "bool",
630
    "list",
618 631
    )
619 632
  TYPE_CHECKER = Option.TYPE_CHECKER.copy()
620 633
  TYPE_CHECKER["identkeyval"] = check_ident_key_val
621 634
  TYPE_CHECKER["keyval"] = check_key_val
622 635
  TYPE_CHECKER["unit"] = check_unit
623 636
  TYPE_CHECKER["bool"] = check_bool
637
  TYPE_CHECKER["list"] = check_list
624 638

  
625 639

  
626 640
# optparse.py sets make_option, so we do it for our own option class, too

Also available in: Unified diff