def get_format_invocation(f, clang_format_binary, fix, warnings_as_errors, quiet):
  """Gets a command line for clang-format."""
  start = [clang_format_binary]
  if fix:
    start.append('-i')
  else:
    start.append('--dry-run')
  if warnings_as_errors:
    start.append('--Werror')
  start.append(f)
  return start