<Purpose>
    Returns all valid input completions for the specified command line input.

  <Arguments>
    input_list: A list of tokens.

  <Side Effects>
    None

  <Exceptions>
    None

  <Returns>
    A list of strings representing valid completions.

def autocomplete(input_list):
  """
  <Purpose>
    Returns all valid input completions for the specified command line input.

  <Arguments>
    input_list: A list of tokens.

  <Side Effects>
    None

  <Exceptions>
    None

  <Returns>
    A list of strings representing valid completions.
  """
  # We are only interested if the last token starts with a single '$'
  # Double $$'s indicate that it is meant to be a '$', so we don't do anything.
  if input_list[-1].startswith('$') and not input_list[-1].startswith('$$'):
    # Omit the '$'
    partial_variable = input_list[-1][1:]
    commands = []

    for variable in uservariables:
      # No need to include variables that don't match...
      if variable.startswith(partial_variable):
        # Reconstruct the string
        tokens = input_list[:-1] + ['$'+variable]
        commands.append(' '.join(tokens))
    return commands
  return []