-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | open bookmarks and queries from the command line
--
-- This package provides a command-line utility that opens bookmarks and
-- queries. Please see the README on GitHub at
-- https://github.com/ExtremaIS/bm-haskell#readme.
@package bm
@version 0.2.0.0
module BM
-- | bm version string ("bm-haskell X.X.X.X")
version :: String
-- | CLI argument or process argument
type Argument = String
-- | Process command
--
-- This command is executed with a single URL argument to open a
-- bookmark/query.
type Command = FilePath
-- | Error message
type Error = String
-- | Bookmark keyword
--
-- The configuration file defines a hierarchy of keywords that are
-- matched against CLI arguments to determine which bookmark/query to
-- open.
type Keyword = String
-- | Query parameter name
type ParameterName = String
-- | Query parameter value
type ParameterValue = String
-- | Trace line for debugging
type Trace = String
-- | Bookmark or query action URL
type Url = String
-- | Configuration
--
-- YAML attributes:
--
--
-- - command: top-level command (string, default depends on
-- the OS)
-- - args: bookmarks (array of Bookmark)
--
--
-- Default commands:
--
--
-- - Linux: xdg-open
-- - Windows: start
-- - macOS: open
--
data Config
Config :: !Command -> !Vector Bookmark -> Config
[configCommand] :: Config -> !Command
[configArgs] :: Config -> !Vector Bookmark
-- | Bookmark definition
--
-- YAML attributes:
--
--
-- - keyword: bookmark keyword (string)
-- - command: command for this bookmark and children (string,
-- optional)
-- - url: bookmark URL (string, optional)
-- - query: bookmark query definition (Query,
-- optional)
-- - args: child bookmarks (array of Bookmark,
-- optional)
--
--
-- A command be set to override the top-level command, but this is
-- generally not done. If a bookmark is selected and there is no URL, the
-- first child is processed. Only one of query and args
-- may be present.
data Bookmark
Bookmark :: !Keyword -> !Maybe Command -> !Maybe Url -> !Either Query (Vector Bookmark) -> Bookmark
[keyword] :: Bookmark -> !Keyword
[mCommand] :: Bookmark -> !Maybe Command
[mUrl] :: Bookmark -> !Maybe Url
[queryOrArgs] :: Bookmark -> !Either Query (Vector Bookmark)
-- | Query definition
--
-- YAML attributes:
--
--
-- - action: URL (string)
-- - parameter: query parameter name (string, default:
-- q)
-- - hidden: array of constant parameters
-- (Parameter)
--
data Query
Query :: !Url -> !ParameterName -> !Vector Parameter -> Query
[action] :: Query -> !Url
[parameter] :: Query -> !ParameterName
[hiddenParameters] :: Query -> !Vector Parameter
-- | HTTP GET parameter definition
--
-- YAML attributes:
--
--
-- - name: parameter name
-- - value: constant parameter value
--
data Parameter
Parameter :: !ParameterName -> !ParameterValue -> Parameter
[name] :: Parameter -> !ParameterName
[value] :: Parameter -> !ParameterValue
-- | Process specification
data Proc
Proc :: !Command -> ![Argument] -> Proc
[command] :: Proc -> !Command
[arguments] :: Proc -> ![Argument]
-- | Determine the process to execute for the given config and CLI
-- arguments
run :: Config -> [Argument] -> (Either Error Proc, [Trace])
-- | Get CLI completion options
getCompletion :: Config -> [Argument] -> [Argument]
instance GHC.Show.Show BM.Parameter
instance GHC.Show.Show BM.Query
instance GHC.Show.Show BM.Bookmark
instance GHC.Show.Show BM.Config
instance GHC.Show.Show BM.Proc
instance GHC.Classes.Eq BM.Proc
instance Data.Aeson.Types.FromJSON.FromJSON BM.Config
instance Data.Aeson.Types.FromJSON.FromJSON BM.Bookmark
instance Data.Aeson.Types.FromJSON.FromJSON BM.Query
instance Data.Aeson.Types.FromJSON.FromJSON BM.Parameter