only 0.0.3.0 → 0.0.4.0
raw patch · 2 files changed
+7/−12 lines, 2 files
Files
- only.cabal +5/−5
- only.hs +2/−7
only.cabal view
@@ -1,5 +1,5 @@ Cabal-version: >= 1.2.0.0-version: 0.0.3.0+version: 0.0.4.0 name: only license: GPL@@ -7,13 +7,13 @@ author: Andrew Robbins <and_j_rob@yahoo.com> maintainer: Andrew Robbins <and_j_rob@yahoo.com> copyright: 2008 Andrew Robbins-category: tools+category: Console build-type: Simple-stability: experimental+stability: Experimental synopsis: A grep-like tool for filtering on words or lines. description: The 'only' command-line tool lets you search based- on word patterns or line patterns like never before! Not only can - you search with 'only -l patt' but you can select the n-th match + on word patterns or line patterns like never before! Not only can+ you search with 'only -l patt' but you can select the n-th match with '-l n\/patt\/' and the next 3 lines with '-l \/patt\/0:3'. executable only
only.hs view
@@ -1,12 +1,7 @@--- ------------------------------------------------------------------- | -- Executable : 'only' -- Copyright : (C) 2008 Andrew Robbins -- Maintainer : Andrew Robbins <and_j_rob(AT)yahoo.com> -- Stability : experimental--- Portability : portable--- Description : Tool for comprehensive grep'ing--- module Main where import Control.Monad (when, unless)@@ -25,7 +20,7 @@ progName = "only" -- usage stuff-version = "only (GNU Only) 0.0.3.0\n"+version = "only (GNU Only) 0.0.4.0\n" header = unlines [ version,@@ -156,7 +151,7 @@ number = do abs <- parseDigits if abs == [] then word- else return (OnlyExpr abs "hello" [])+ else return (OnlyExpr abs "" []) regex = do abs <- parseDigits ch <- noneOf $ ".,:;" ++ ['A'..'Z'] ++ ['a'..'z']