docs: def create_args(line, namespace):
      """ Expand any meta-variable references in the argument list. """
      args = []
      # Using shlex.split handles quotes args and escape characters.
      for arg in shlex.split(line):
        if not arg:
           continue
        if arg[0] == '$':
          var_name = arg[1:]
          if var_name in namespace:
            args.append((namespace[var_name]))
          else:
            raise Exception('Undefined variable referenced in command line: %s' % arg)
        else:
          args.append(arg)
      return args