code: def split_commandline(s, comments=False, posix=True):
      
      # shlex seems to remove unescaped quotes and backslashes
      s = s.replace('\\', '\\\\')
      s = s.replace('\'', '\\\'')
      s = s.replace('\"', '\\\"')
      lex = shlex.shlex(s, posix=posix)
      lex.whitespace_split = True
      lex.whitespace = ';'
      if not comments:
          lex.commenters = ''
      return list(lex)
docs: splits semi-colon separated commandlines