Revision 60d49723 lib/cli.py

b/lib/cli.py
43 43
           "ARGS_NONE", "ARGS_FIXED", "ARGS_ATLEAST", "ARGS_ANY", "ARGS_ONE",
44 44
           "USEUNITS_OPT", "FIELDS_OPT", "FORCE_OPT",
45 45
           "ListTags", "AddTags", "RemoveTags", "TAG_SRC_OPT",
46
           "FormatError",
46
           "FormatError", "SplitNodeOption"
47 47
           ]
48 48

  
49 49

  
......
179 179
TAG_SRC_OPT = make_option("--from", dest="tags_source",
180 180
                          default=None, help="File with tag names")
181 181

  
182

  
182 183
def ARGS_FIXED(val):
183 184
  """Macro-like function denoting a fixed number of arguments"""
184 185
  return -val
......
286 287
  return func, options, args
287 288

  
288 289

  
290
def SplitNodeOption(value):
291
  """Splits the value of a --node option.
292

  
293
  """
294
  if value and ':' in value:
295
    return value.split(':', 1)
296
  else:
297
    return (value, None)
298

  
299

  
289 300
def AskUser(text, choices=None):
290 301
  """Ask the user a question.
291 302

  

Also available in: Unified diff