cgrep 6.5.13 → 6.5.15
raw patch · 9 files changed
+19/−19 lines, 9 files
Files
- README.md +2/−2
- cgrep.cabal +1/−1
- src/CGrep/Common.hs +3/−3
- src/CGrep/Strategy/Cpp/Semantic.hs +2/−2
- src/CGrep/Strategy/Generic/Semantic.hs +2/−2
- src/CmdOptions.hs +4/−3
- src/Config.hs +0/−3
- src/Main.hs +4/−2
- src/Options.hs +1/−1
README.md view
@@ -4,7 +4,7 @@ Usage ----- -Cgrep 6.5.13 Usage: cgrep [OPTION] [PATTERN] files...+Cgrep 6.5.15 Usage: cgrep [OPTION] [PATTERN] files... cgrep [OPTIONS] [ITEM] @@ -76,7 +76,7 @@ Miscellaneous: -d --debug=INT debug level: 1, 2 or 3- -n --no-turbo disable turbo mode+ -n --no-quick disable quick-search mode -? --help Display help message -V --version Print version information
cgrep.cabal view
@@ -1,6 +1,6 @@ Name: cgrep Description: Cgrep: a context-aware grep for source codes-Version: 6.5.13+Version: 6.5.15 Synopsis: Command line tool Homepage: http://awgn.github.io/cgrep/ License: GPL-2
src/CGrep/Common.hs view
@@ -58,9 +58,9 @@ quickSearch :: Options -> [Text8] -> Text8 -> Maybe Bool quickSearch opt ps text- | no_turbo opt = Nothing- | otherwise = Just $ any has_pattern ps || null ps- where has_pattern pat = notNull $ pat `SC.nonOverlappingIndices` text+ | no_quick opt = Nothing+ | otherwise = Just $ all findToken ps || null ps+ where findToken tok = notNull $ tok `SC.nonOverlappingIndices` text runQuickSearch :: FilePath
src/CGrep/Strategy/Cpp/Semantic.hs view
@@ -61,13 +61,13 @@ -- quickSearch - identif = (mapMaybe (\x -> case x of+ identif = mapMaybe (\x -> case x of TokenCard (Cpp.TokenChar xs _) -> Just (rmQuote $ trim xs) TokenCard (Cpp.TokenString xs _) -> Just (rmQuote $ trim xs) TokenCard (Cpp.TokenIdentifier "OR" _) -> Nothing TokenCard t -> Just (Cpp.toString t) _ -> Nothing- ) . concat) patterns''+ ) . concat $ patterns'' -- put banners...
src/CGrep/Strategy/Generic/Semantic.hs view
@@ -63,12 +63,12 @@ -- quickSearch ... - ps' = (mapMaybe (\x -> case x of+ ps' = mapMaybe (\x -> case x of TokenCard (Generic.TokenLiteral xs _) -> Just (rmQuote $ trim xs) TokenCard (Generic.TokenAlpha "OR" _) -> Nothing TokenCard t -> Just (tkToString t) _ -> Nothing- ) . concat) patterns'+ ) . concat $ patterns' -- put banners...
src/CmdOptions.hs view
@@ -18,10 +18,11 @@ module CmdOptions where +import Data.Version(showVersion) import System.Console.CmdArgs +import Paths_cgrep import Options-import Config options :: Mode (CmdArgs Options) options = cmdArgsMode $ Options@@ -71,7 +72,7 @@ , chunk = 16 &= help "Specify the length of chunks" , asynch = False &= help "Process chunks asynchronously" , debug = 0 &= groupname "\nMiscellaneous" &= help "Debug level: 1, 2 or 3"- , no_turbo = False &= help "Disable turbo mode"+ , no_quick = False &= help "Disable quick-search mode" , others = [] &= args- } &= summary ("Cgrep " ++ version ++ ". Usage: cgrep [OPTION] [PATTERN] files...") &= program "cgrep"+ } &= summary ("Cgrep " ++ showVersion version ++ ". Usage: cgrep [OPTION] [PATTERN] files...") &= program "cgrep"
src/Config.hs view
@@ -32,9 +32,6 @@ cgreprc :: FilePath cgreprc = "cgreprc" -version :: String-version = "6.5.13"- data Config = Config { configLanguages :: [Lang]
src/Main.hs view
@@ -24,8 +24,10 @@ import Data.Maybe import Data.Char import Data.Data()+import Data.Version(showVersion) import Data.Function import qualified Data.Set as Set+import Paths_cgrep import Control.Exception as E import Control.Concurrent@@ -68,7 +70,7 @@ getFilesMagic :: [FilePath] -> IO [String]-getFilesMagic filenames = fmap lines $ readProcess "/usr/bin/file" (["-b" ] ++ filenames) []+getFilesMagic filenames = lines <$> readProcess "/usr/bin/file" ("-b" : filenames) [] -- push file names in Chan...@@ -244,7 +246,7 @@ let langs = (if null l0 then configLanguages conf else l0 `union` l1) \\ l2 - runReaderT (do putStrLevel1 $ "Cgrep " ++ version ++ "!"+ runReaderT (do putStrLevel1 $ "Cgrep " ++ showVersion version ++ "!" putStrLevel1 $ "options : " ++ show opts putStrLevel1 $ "languages : " ++ show langs putStrLevel1 $ "pattern : " ++ show patterns'
src/Options.hs view
@@ -77,7 +77,7 @@ , asynch :: Bool -- Misc: , debug :: Int- , no_turbo :: Bool+ , no_quick :: Bool , others :: [String] } deriving (Data, Typeable, Show)