src/cline.c

changeset 57
68018eac46c3
parent 50
63477d92411d
child 59
c5409c8be36f
     1.1 --- a/src/cline.c	Thu Aug 23 17:58:38 2018 +0200
     1.2 +++ b/src/cline.c	Thu Aug 23 19:45:36 2018 +0200
     1.3 @@ -1,6 +1,6 @@
     1.4  /*
     1.5   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 
     1.6 - * Copyright 2017 Mike Becker. All rights reserved.
     1.7 + * Copyright 2018 Mike Becker. All rights reserved.
     1.8   * 
     1.9   * Redistribution and use in source and binary forms, with or without
    1.10   * modification, are permitted provided that the following conditions are met:
    1.11 @@ -21,12 +21,7 @@
    1.12   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    1.13   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.14   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    1.15 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    1.16 - *
    1.17 - * cline.c
    1.18 - *
    1.19 - *  Created on: 23.05.2011
    1.20 - *      Author: Mike
    1.21 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.22   */
    1.23  
    1.24  #include "cline.h"
    1.25 @@ -58,8 +53,8 @@
    1.26      "\n  -v, --version       - print out version information"
    1.27      "\n  -V                  - turn verbose output off, print the result only"
    1.28      "\n\nShortcuts:"
    1.29 -    "\n  --exclude-cstyle-comments"
    1.30 -    "\n = -E \"\\s*//\" -e \"\\s*/\\*\" \"\\*/\\s*\""
    1.31 +    "\n  --exclude-cstyle-comments : -E '\\s*//' -e '\\s*/\\*' '\\*/\\s*'"
    1.32 +    "\n  --exclude-blank-lines     : -E '^\\s*$'"
    1.33      "\n\n"
    1.34      "The default call without any options is:"    
    1.35      "\n  cline ./\n\n"
    1.36 @@ -205,12 +200,14 @@
    1.37      }
    1.38      if (argflags == 0) {
    1.39        /* SHORTCUTS */
    1.40 -      /* exclude-cstyle-comments */
    1.41        if (strcmp(argv[t], "--exclude-cstyle-comments") == 0) {
    1.42          add_string(settings->regex->pattern_list, "\\s*//");
    1.43          add_string(settings->regex->pattern_list, "$");
    1.44          add_string(settings->regex->pattern_list, "\\s*/\\*");
    1.45          add_string(settings->regex->pattern_list, "\\*/\\s*");
    1.46 +      } else if (strcmp(argv[t], "--exclude-blank-lines") == 0) {
    1.47 +        add_string(settings->regex->pattern_list, "^\\s*$");
    1.48 +        add_string(settings->regex->pattern_list, "$");
    1.49        }
    1.50        /* Path */
    1.51        else {

mercurial