docs: def main(arguments=None):
      """
      The main function used when ``cl_utils.py`` is run as a single script from the cl, or when installed as a cl command
  
      .. todo ::
  
          - update key arguments values and definitions with defaults
          - update return values and definitions
          - update usage examples and text
          - update docstring text
          - check sublime snippet exists
          - clip any useful text to docs mindmap
          - regenerate the docs and check redendering of this docstring
      """
      # setup the command-line util settings
  
      su = tools(
          arguments=arguments,
          docString=__doc__,
          logLevel="WARNING",
          options_first=False,
          projectName="sherlock"
      )
      arguments, settings, log, dbConn = su.setup()
  
      # unpack remaining cl arguments using `exec` to setup the variable names
      # automatically
      for arg, val in arguments.iteritems():
          if arg[0] == "-":
              varname = arg.replace("-", "") + "Flag"
          else:
              varname = arg.replace("<", "").replace(">", "")
              if varname == "import":
                  varname = "iimport"
          if isinstance(val, str) or isinstance(val, unicode):
              exec(varname + " = '%s'" % (val,))
          else:
              exec(varname + " = %s" % (val,))
          if arg == "--dbConn":
              dbConn = val
          log.debug('%s = %s' % (varname, val,))
  
      ## START LOGGING ##
      startTime = times.get_now_sql_datetime()
      log.debug(
          '--- STARTING TO RUN THE cl_utils.py AT %s' %
          (startTime,))
  
      # call the worker function
      # x-if-settings-or-database-credientials
      if init:
          from os.path import expanduser
          home = expanduser("~")
          filepath = home + "/.config/sherlock/sherlock.yaml"
          cmd = """open %(filepath)s""" % locals()
          p = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True)
          try:
              cmd = """open %(filepath)s""" % locals()
              p = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True)
          except:
              pass
          try:
              cmd = """start %(filepath)s""" % locals()
              p = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True)
          except:
              pass
  
      if match or dbmatch:
          if verboseFlag:
              verbose = 2
          else:
              verbose = 1
  
          if skipNedUpdateFlag:
              updateNed = False
          else:
              updateNed = True
  
          if skipMagUpdateFlag:
              updatePeakMags = False
          else:
              updatePeakMags = True
  
          classifier = transient_classifier.transient_classifier(
              log=log,
              settings=settings,
              ra=ra,
              dec=dec,
              name=False,
              verbose=verbose,
              update=updateFlag,
              updateNed=updateNed,
              updatePeakMags=updatePeakMags
          )
          classifier.classify()
  
      if clean:
          cleaner = database_cleaner(
              log=log,
              settings=settings
          )
          cleaner.clean()
      if wiki:
          updateWiki = update_wiki_pages(
              log=log,
              settings=settings
          )
          updateWiki.update()
  
      if iimport and ned:
          ned = nedStreamImporter(
              log=log,
              settings=settings,
              coordinateList=["%(ra)s %(dec)s" % locals()],
              radiusArcsec=radiusArcsec
          )
          ned.ingest()
      if iimport and cat:
  
          if cat_name == "veron":
              catalogue = veronImporter(
                  log=log,
                  settings=settings,
                  pathToDataFile=pathToDataFile,
                  version=cat_version,
                  catalogueName=cat_name
              )
              catalogue.ingest()
  
          if "ned_d" in cat_name:
              catalogue = nedImporter(
                  log=log,
                  settings=settings,
                  pathToDataFile=pathToDataFile,
                  version=cat_version,
                  catalogueName=cat_name
              )
              catalogue.ingest()
      if iimport and stream:
          if "marshall" in stream_name:
              stream = marshallImporter(
                  log=log,
                  settings=settings,
              )
              stream.ingest()
          if "ifs" in stream_name:
              stream = ifsImporter(
                  log=log,
                  settings=settings
              )
              stream.ingest()
      if not init and not match and not clean and not wiki and not iimport and ra:
  
          classifier = transient_classifier.transient_classifier(
              log=log,
              settings=settings,
              ra=ra,
              dec=dec,
              name=False,
              verbose=verboseFlag
          )
          classifier.classify()
  
      if info:
          print "sherlock-catalogues"
          wiki = update_wiki_pages(
              log=log,
              settings=settings
          )
          table = list(wiki._get_table_infos(trimmed=True))
  
          dataSet = list_of_dictionaries(
              log=log,
              listOfDictionaries=table
          )
          tableData = dataSet.reST(filepath=None)
          print tableData
          print
  
          print "Crossmatch Streams"
          table = list(wiki._get_stream_view_infos(trimmed=True))
          dataSet = list_of_dictionaries(
              log=log,
              listOfDictionaries=table
          )
          tableData = dataSet.reST(filepath=None)
          print tableData
          print
  
          print "Views on Catalogues and Streams"
  
          table = list(wiki._get_view_infos(trimmed=True))
          dataSet = list_of_dictionaries(
              log=log,
              listOfDictionaries=table
          )
          tableData = dataSet.reST(filepath=None)
          print tableData
  
      if "dbConn" in locals() and dbConn:
          dbConn.commit()
          dbConn.close()
      ## FINISH LOGGING ##
      endTime = times.get_now_sql_datetime()
      runningTime = times.calculate_time_difference(startTime, endTime)
      log.debug('-- FINISHED ATTEMPT TO RUN THE cl_utils.py AT %s (RUNTIME: %s) --' %
                (endTime, runningTime, ))
  
      return