sloane 1.5.1 → 1.6
raw patch · 5 files changed
+14/−10 lines, 5 files
Files
- README.md +2/−2
- changelog.md +4/−0
- sloane.1 +1/−1
- sloane.cabal +2/−2
- sloane.hs +5/−5
README.md view
@@ -1,6 +1,6 @@ ----title: SLOANE(1) Sloane User Manual | Version 1.5.1-date: March 9, 2014+title: SLOANE(1) Sloane User Manual | Version 1.6+date: March 18, 2014 --- # NAME
+ changelog.md view
@@ -0,0 +1,4 @@+sloane 1.6 - March 18, 2014+===========================++* Properly handle multiple search terms.
sloane.1 view
@@ -1,4 +1,4 @@-.TH "SLOANE" "1" "March 9, 2014" "Sloane User Manual" "Version 1.5.1"+.TH "SLOANE" "1" "March 18, 2014" "Sloane User Manual" "Version 1.6" .SH NAME .PP sloane \- a command line interface to Sloane\[aq]s On\-Line Encyclopedia
sloane.cabal view
@@ -1,5 +1,5 @@ Name: sloane-Version: 1.5.1+Version: 1.6 Synopsis: A command line interface to Sloane's On-Line Encyclopedia of Integer Sequences Description: A command line interface to Sloane's On-Line Encyclopedia of Integer Sequences. For usage see <http://github.com/akc/sloane>.@@ -10,7 +10,7 @@ Maintainer: anders.claesson@gmail.com Category: Math Build-type: Custom-Extra-Source-Files: README.md sloane.1+Extra-Source-Files: README.md sloane.1 changelog.md Cabal-version: >=1.6
sloane.hs view
@@ -28,7 +28,7 @@ , all :: Bool , url :: Bool , limit :: Int- , terms :: String+ , terms :: [String] } deriving (Data, Typeable) @@ -37,9 +37,9 @@ , all = False &= name "a" &= help "Print all fields" , url = False &= name "u" &= help "Print urls of found entries" , limit = 5 &= name "n" &= help "Retrieve at most this many entries (default: 5)"- , terms = def &= argPos 0 &= typ "SEARCH-TERMS"+ , terms = def &= args &= typ "SEARCH-TERMS" }- &= versionArg [summary "sloane 1.5.1"]+ &= versionArg [summary "sloane 1.6"] &= summary "Search Sloane's On-Line Encyclopedia of Integer Sequences" select :: Keys -> OEISEntries -> OEISEntries@@ -90,10 +90,10 @@ put $ ' ' : crop width (unwords rest) ++ "\n" main = do- args <- cmdArgsRun sloane+ args <- cmdArgsRun sloane ncols <- getWidth let pick = if all args then id else select (keys args)- let query = filter (`notElem` "[{}]") $ terms args+ let query = unwords $ terms args hits <- searchOEIS (limit args) query unless (null hits) $ do newline