https://bugs.llvm.org/show_bug.cgi?id=45126

            Bug ID: 45126
           Summary: clang-format doesn't document --style=GNU
           Product: clang
           Version: 9.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

clang-format's frontend supports GNU as one of the --style options:

$ cat hello.c
#include <stdio.h>

int main(int argc, char *argv[])
{
    FILE *f;

    if (argc != 2) {
       printf("usage: %s file\n", argv[0]);
       return 1;
    }
    f = fopen(argv[1], "w");
    if (f == NULL) {
       printf("couldn't open %s\n", argv[1]);
       return 1;
    }
    fprintf(f, "Hello world!\n");
    fclose(f);
    return 0;
}

$ clang-format --style=GNU hello.c
#include <stdio.h>

int
main (int argc, char *argv[])
{
  FILE *f;

  if (argc != 2)
    {
      printf ("usage: %s file\n", argv[0]);
      return 1;
    }
  f = fopen (argv[1], "w");
  if (f == NULL)
    {
      printf ("couldn't open %s\n", argv[1]);
      return 1;
    }
  fprintf (f, "Hello world!\n");
  fclose (f);
  return 0;
}

but the help message does not indicate it:

--style=<string>           - Coding style, currently supports:
                               LLVM, Google, Chromium, Mozilla, WebKit

This should be added to the help message and documentation.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to