# HG changeset patch # User Mike Becker # Date 1329156600 -3600 # Node ID 27c3c1c6b768195a818607816a50c2cc23067f7c # Parent d642fdb6745e77eb619a6262d4e6053bf1f2be97 added --exclude-cstyle-comments shortcut diff -r d642fdb6745e -r 27c3c1c6b768 cline.c --- a/cline.c Thu Feb 09 15:56:18 2012 +0100 +++ b/cline.c Mon Feb 13 19:10:00 2012 +0100 @@ -34,6 +34,9 @@ "\n -r, -R - includes subdirectories" "\n -v, --version - print out version information" "\n -V - turn verbose output off, print the result only" + "\n\nShortcuts:" + "\n --exclude-cstyle-comments" + "\n = -E \"\\s*//\" -e \"\\s*/\\*\" \"\\*/\\s*\"" "\n\n" "The default call without any options is:" "\n cline ./\n\n" @@ -46,8 +49,8 @@ "\ncounted when it does not start or end with the respective patterns." "\nPlease note, that cline does not remove whitespace characters as this" "\nmight not be reasonable in some cases." - "\n\nExample (C comments):" - "\n cline -s .c,.h -E \"\\s*//\" -e \"\\s*/\\*\" \"\\*/\\s*\""; + "\n\nExample (C without comments):" + "\n cline -s .c,.h --exclude-cstyle-comments"; printf(helpText); } @@ -173,9 +176,17 @@ add_string(settings->regex->pattern_list, argv[t]); add_string(settings->regex->pattern_list, "$"); } - /* Path */ if (argflags == 0) { - if (registerArgument(&checked, 1024)) { + /* SHORTCUTS */ + /* exclude-cstyle-comments */ + if (strcmp(argv[t], "--exclude-cstyle-comments") == 0) { + add_string(settings->regex->pattern_list, "\\s*//"); + add_string(settings->regex->pattern_list, "$"); + add_string(settings->regex->pattern_list, "\\s*/\\*"); + add_string(settings->regex->pattern_list, "\\*/\\s*"); + } + /* Path */ + else if (registerArgument(&checked, 1024)) { return exit_with_help(settings, 1); } directory = argv[t];