Bump versions and multiple queries

This commit is contained in:
2021-10-27 20:46:23 +03:00
parent eb16640f41
commit 8e57921a1b
8 changed files with 58 additions and 22 deletions

View File

@ -21,6 +21,7 @@ import qualified Operations
import Data.Query
(Field(..))
import qualified Options.Applicative.NonEmpty as NE
commands :: Parser (BuukaM ())
commands = subparser
@ -34,7 +35,7 @@ commands = subparser
f <$> strOption (long "url" <> short 'u' <> metavar "URL")
<*> optional (strOption (long "title"))
queryOpts f =
uncurry f <$> asum [tagged Title "title", tagged Url "url"]
f <$> NE.some1 (asum [tagged Title "title", tagged Url "url"])
tagged t x = (t, ) <$> strOption (long x <> metavar "REGEX")
main :: IO ()