docs: def process_path(label, pth):
     "check and expand paths"
     
     if pth is None:
        sys.exit("no %s path given" % label)
        
     if pth.startswith("/"):
        pass
     elif pth[0] in (".", "~"):
        pth = os.path.realpath(pth)
     else:
        pth = os.getcwd() + os.sep + pth
     
     if not os.path.exists(pth):
        sys.exit("%s path %s does not exist" % (label, pth))
  
     return pth