docs: def update(identifiers, nopull, only):
      '''
      Performs a `git pull` in each of the repositories registered with
      `homely add`, runs all of their HOMELY.py scripts, and then performs
      automatic cleanup as necessary.
  
      REPO
          This should be the path to a local dotfiles repository that has already
          been registered using `homely add`. If you specify one or more `REPO`s
          then only the HOMELY.py scripts from those repositories will be run,
          and automatic cleanup will not be performed (automatic cleanup is only
          possible when homely has done an update of all repositories in one go).
          If you do not specify a REPO, all repositories' HOMELY.py scripts will
          be run.
  
      The --nopull and --only options are useful when you are working on your
      HOMELY.py script - the --nopull option stops you from wasting time checking
      the internet for the same updates on every run, and the --only option
      allows you to execute only the section you are working on.
      '''
      mkcfgdir()
      setallowpull(not nopull)
  
      cfg = RepoListConfig()
      if len(identifiers):
          updatedict = {}
          for identifier in identifiers:
              repo = cfg.find_by_any(identifier, "ilc")
              if repo is None:
                  hint = "Try running %s add /path/to/this/repo first" % CMD
                  raise Fatal("Unrecognised repo %s (%s)" % (identifier, hint))
              updatedict[repo.repoid] = repo
          updatelist = updatedict.values()
          cleanup = len(updatelist) == cfg.repo_count()
      else:
          updatelist = list(cfg.find_all())
          cleanup = True
      success = run_update(updatelist,
                           pullfirst=not nopull,
                           only=only,
                           cancleanup=cleanup)
      if not success:
          sys.exit(1)