src/cline.c

changeset 57
68018eac46c3
parent 50
63477d92411d
child 59
c5409c8be36f
--- a/src/cline.c	Thu Aug 23 17:58:38 2018 +0200
+++ b/src/cline.c	Thu Aug 23 19:45:36 2018 +0200
@@ -1,6 +1,6 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
- * Copyright 2017 Mike Becker. All rights reserved.
+ * Copyright 2018 Mike Becker. All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -21,12 +21,7 @@
  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- *
- * cline.c
- *
- *  Created on: 23.05.2011
- *      Author: Mike
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "cline.h"
@@ -58,8 +53,8 @@
     "\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  --exclude-cstyle-comments : -E '\\s*//' -e '\\s*/\\*' '\\*/\\s*'"
+    "\n  --exclude-blank-lines     : -E '^\\s*$'"
     "\n\n"
     "The default call without any options is:"    
     "\n  cline ./\n\n"
@@ -205,12 +200,14 @@
     }
     if (argflags == 0) {
       /* 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*");
+      } else if (strcmp(argv[t], "--exclude-blank-lines") == 0) {
+        add_string(settings->regex->pattern_list, "^\\s*$");
+        add_string(settings->regex->pattern_list, "$");
       }
       /* Path */
       else {

mercurial