packages feed

cgrep 6.6 → 6.6.1

raw patch · 5 files changed

+15/−12 lines, 5 files

Files

README.md view
@@ -4,7 +4,7 @@ Usage ----- -Cgrep 6.6. Usage: cgrep [OPTION] [PATTERN] files...+Cgrep 6.6.1. Usage: cgrep [OPTION] [PATTERN] files...  cgrep [OPTIONS] [ITEM] @@ -65,8 +65,9 @@  Output format: -       --color                 Use colors to highlight the matching strings        --show-match            Show list of matching tokens+       --color                 Use colors to highlight the matching strings+       --no-color              Do not use colors (override configAutoColor)     -h --no-filename           Suppress the file name prefix on output     -N --no-linenumber         Suppress the line number on output lines        --count                 Print only a count of matching lines per file
cgrep.cabal view
@@ -1,6 +1,6 @@ Name:                cgrep Description:         Cgrep: a context-aware grep for source codes-Version:             6.6+Version:             6.6.1 Synopsis:            Command line tool Homepage:            http://awgn.github.io/cgrep/ License:             GPL-2
src/CGrep/Output.hs view
@@ -216,15 +216,15 @@   showFile :: Options -> String -> String-showFile Options { color = c } f-    | c         = bold ++ blue ++ f ++ resetTerm-    | otherwise = f+showFile Options { color = c, no_color = c'} f+    | c && not c'= bold ++ blue ++ f ++ resetTerm+    | otherwise  = f   showLine :: Options -> [Token] -> Line8 -> String-showLine Options { color = c } ts l-    | c         = hilightLine (sortBy (flip compare `on` (length . snd )) ts) (C.unpack l)-    | otherwise = C.unpack l+showLine Options { color = c, no_color = c' } ts l+    | c && not c'= hilightLine (sortBy (flip compare `on` (length . snd )) ts) (C.unpack l)+    | otherwise  = C.unpack l   hilightLine :: [Token] -> String -> String
src/CmdOptions.hs view
@@ -56,8 +56,9 @@           ,     recursive = False           &= help "Enable recursive search (don't follow symlinks)" &= explicit &= name "recursive" &= name "r"           ,     prune_dir = []              &= help "Do not descend into dir" &= explicit &= name "prune-dir"           ,     deference_recursive = False &= help "Recursive, follow symlinks" &= explicit &= name "deference-recursive" &= name "R"-          ,     color = False               &= groupname "\nOutput format" &= help "Use colors to highlight the matching strings" &= explicit &= name "color"-          ,     show_match = False          &= help "Show list of matching tokens" &= explicit &= name "show-match"+          ,     show_match = False          &= groupname "\nOutput format" &= help "Show list of matching tokens" &= explicit &= name "show-match"+          ,     color = False               &= help "Use colors to highlight the matching strings" &= explicit &= name "color"+          ,     no_color = False            &= help "Do not use colors (override configAutoColor)" &= explicit &= name "no-color"           ,     no_filename = False         &= help "Suppress the file name prefix on output"  &= explicit &= name "h" &= name "no-filename"           ,     no_linenumber= False        &= help "Suppress the line number on output lines" &= explicit &= name "N" &= name "no-linenumber"           ,     count = False               &= help "Print only a count of matching lines per file" &= explicit &= name "count"
src/Options.hs view
@@ -59,8 +59,9 @@     ,   prune_dir           :: [FilePath]     ,   deference_recursive :: Bool     -- Output format:-    ,   color               :: Bool     ,   show_match          :: Bool+    ,   color               :: Bool+    ,   no_color            :: Bool     ,   no_filename         :: Bool     ,   no_linenumber       :: Bool     ,   count               :: Bool