diff --git a/CHANGELOG.md b/CHANGELOG.md index 73969d8..9927db3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,16 @@ and this project adheres to the ### Added +### Fixed + +### Changed + +### Removed + +## [0.5.0.0] - 2023-03-14 + +### Added + - Integration with Nix. - Help message footer - links to online docs and bug tracker. - `hoyo help ` command - does the same thing as `hoyo --help` and `hoyo --help`. @@ -203,7 +213,8 @@ build docs using a pre-commit hook. - Initial release. -[unreleased]: https://github.com/fpringle/hoyo/compare/v0.4.0.0...HEAD +[unreleased]: https://github.com/fpringle/hoyo/compare/v0.5.0.0...HEAD +[0.5.0.0]: https://github.com/fpringle/hoyo/compare/v0.4.0.0...v0.5.0.0 [0.4.0.0]: https://github.com/fpringle/hoyo/compare/v0.3.0.0...v0.4.0.0 [0.3.0.0]: https://github.com/fpringle/hoyo/compare/v0.2.3.1...v0.3.0.0 [0.2.3.1]: https://github.com/fpringle/hoyo/compare/v0.2.3.0...v0.2.3.1 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 73969d8..9927db3 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -10,6 +10,16 @@ and this project adheres to the ### Added +### Fixed + +### Changed + +### Removed + +## [0.5.0.0] - 2023-03-14 + +### Added + - Integration with Nix. - Help message footer - links to online docs and bug tracker. - `hoyo help ` command - does the same thing as `hoyo --help` and `hoyo --help`. @@ -203,7 +213,8 @@ build docs using a pre-commit hook. - Initial release. -[unreleased]: https://github.com/fpringle/hoyo/compare/v0.4.0.0...HEAD +[unreleased]: https://github.com/fpringle/hoyo/compare/v0.5.0.0...HEAD +[0.5.0.0]: https://github.com/fpringle/hoyo/compare/v0.4.0.0...v0.5.0.0 [0.4.0.0]: https://github.com/fpringle/hoyo/compare/v0.3.0.0...v0.4.0.0 [0.3.0.0]: https://github.com/fpringle/hoyo/compare/v0.2.3.1...v0.3.0.0 [0.2.3.1]: https://github.com/fpringle/hoyo/compare/v0.2.3.0...v0.2.3.1 diff --git a/docs/HoYo-Bookmark.html b/docs/HoYo-Bookmark.html deleted file mode 100644 index f3eaf2d..0000000 --- a/docs/HoYo-Bookmark.html +++ /dev/null @@ -1,17 +0,0 @@ -HoYo.Bookmark
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

HoYo.Bookmark

Description

The Bookmark type provides a representation of bookmarks saved and used -by the hoyo program. This module exports some utility datatypes and functions -used for working with bookmarks.

The Bookmark type

data Bookmark Source #

Bookmark a directory for easy cd. A bookmark remembers the directory, - the index, the creation time, and optionally a user-specified nickname - for the bookmark.

Instances

Instances details
Show Bookmark Source # 
Instance details

Defined in HoYo.Internal.Types

newtype Bookmarks Source #

Wrapper for [Bookmark].

Constructors

Bookmarks 

Fields

Instances

Instances details
Show Bookmarks Source # 
Instance details

Defined in HoYo.Internal.Types

data BookmarkSearchTerm Source #

Data-type for represting a bookmark search. You can either search - by index or by name. Used by the delete and move commands.

formatBookmark :: Bool -> Int -> Bookmark -> Text Source #

Format a Bookmark. Used for the "list" command and error reporting - during other commands.

formatBookmark displayTime numberWidth bm returns a pretty representation - of bm, optionally showing the creation time, and padding the index to a - certain width.

formatBookmarks :: Bool -> [Bookmark] -> [Text] Source #

Format a list of Bookmarks. Used for the "list" command and error reporting - during other commands

formatBookmark displayTime bms returns a pretty representation - of bms, optionally showing the creation time, and padding the indices to - line up.

data DefaultBookmark Source #

Default bookmarks to save at init. A default bookmark remembers the directory - and optionally a user-specified nickname for the bookmark.

Working with bookmarks

getBookmarks :: HoYoMonad Bookmarks Source #

Get the bookmarks from the currently used bookmark file.

searchBookmarks :: BookmarkSearchTerm -> Bookmarks -> ([Bookmark], [Bookmark]) Source #

searchBookmarks searchTerm bookmarks partitions bookmarks into a list of - Bookmarks that match the search term and a list of those that do not.

filterBookmarks :: Maybe Text -> Maybe Text -> Bookmark -> Bool Source #

Given a bookmark name and a bookmark directory, test if a bookmark matches those - filters.

filterBookmarkByName :: Maybe Text -> Bookmark -> Bool Source #

A predicate used by filterBookmarks - match on the bookmark name. - Note that matching is case-sensitive.

filterBookmarkByDirInfix :: Maybe Text -> Bookmark -> Bool Source #

A predicate used by filterBookmarks - match on the bookmark directory.

bookmarksFromDefault :: MonadIO m => [DefaultBookmark] -> m Bookmarks Source #

Convert a list of DefaultBookmarks to a Bookmarks, assiging indices and/ - creation times on the fly.

Parsing/encoding bookmarks from/to TOML

bookmarkCodec :: TomlCodec Bookmark Source #

A TomlCodec for encoding and decoding Bookmarks.

encodeBookmarks :: Bookmarks -> Text Source #

Encode a Bookmark to a Text.

encodeBookmarksFile :: MonadIO m => FilePath -> Bookmarks -> m () Source #

Encode a Bookmark to a file.

\ No newline at end of file diff --git a/docs/HoYo-CLI-Complete.html b/docs/HoYo-CLI-Complete.html deleted file mode 100644 index a82f67d..0000000 --- a/docs/HoYo-CLI-Complete.html +++ /dev/null @@ -1 +0,0 @@ -HoYo.CLI.Complete
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

HoYo.CLI.Complete

Description

Bash competion functions used by the CLI.

Documentation

bookmarkCompleter :: Completer Source #

Fetch existing data file and use it to complete bookmark names.

configKeyCompleter :: Completer Source #

Complete configuration keys.

configValueCompleter :: Completer Source #

Complete configuration values.

TODO: could be more sophisticated, considering the current key

\ No newline at end of file diff --git a/docs/HoYo-CLI-Parse.html b/docs/HoYo-CLI-Parse.html deleted file mode 100644 index 4335226..0000000 --- a/docs/HoYo-CLI-Parse.html +++ /dev/null @@ -1,8 +0,0 @@ -HoYo.CLI.Parse
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

HoYo.CLI.Parse

Description

Parse CLI arguments.

Parsing CLI arguments and options

options :: ParserInfo Options Source #

A ParserInfo object containing the necessary information for parsing - CLI commands and arguments, and displaying useful help text.

parseOptions :: Parser Options Source #

Parse an Options argument, which includes the command - to run and any global options.

parseCommand :: Parser Command Source #

Parse a command and the arguments/options for that - command from the command-line arguments.

globalOptions :: Parser GlobalOptions Source #

Parse global options: options that can be set on the command line - no matter what sub-command is being run.

For a complete list of the global options, see GlobalOptions or - run hoyo --help.

overrideOptions :: Parser OverrideOptions Source #

Parse override options: options that override config settings. - This can be useful when you want to temporarily enable functionality - for one CLI run, but don't want to change it in the config file.

Parsing specific CLI commands

addCommand :: Parser Command Source #

Parse options for the hoyo add command.

moveCommand :: Parser Command Source #

Parse options for the hoyo move command.

listCommand :: Parser Command Source #

Parse options for the hoyo list command.

clearCommand :: Parser Command Source #

Parse options for the hoyo clear command.

deleteCommand :: Parser Command Source #

Parse options for the hoyo delete command.

checkCommand :: Parser Command Source #

Parse options for the hoyo check command.

defaultCommand :: Parser Command Source #

If hoyo is run with no arguments, we run the "default command" if it's set.

Parsing sub-commands for hoyo config

configCommand :: Parser Command Source #

Parse options for the hoyo config command.

configPrintCommand :: Parser ConfigCommand Source #

Parse options for the hoyo config print sub-command.

configResetCommand :: Parser ConfigCommand Source #

Parse options for the hoyo config reset sub-command.

configSetCommand :: Parser ConfigCommand Source #

Parse options for the hoyo config set sub-command.

configAddDefaultCommand :: Parser ConfigCommand Source #

Parse options for the hoyo config add-default sub-command.

Misc/Utility

splitArgs :: Text -> [String] Source #

Split a string into arguments as they would be interpreted on the command line.

Adapted from this StackOverflow comment.

\ No newline at end of file diff --git a/docs/HoYo-Command.html b/docs/HoYo-Command.html deleted file mode 100644 index 2745da8..0000000 --- a/docs/HoYo-Command.html +++ /dev/null @@ -1,8 +0,0 @@ -HoYo.Command
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

HoYo.Command

Description

This module defines data-types and runner functions for the hoyo -command-line program.

Synopsis

Running CLI commands

runCommand :: Command -> HoYoMonad () Source #

Run a Command in the hoyo environment.

modifyBookmarks :: ([Bookmark] -> [Bookmark]) -> HoYoMonad () Source #

Helper function whenever we need to modify the saved bookmarks.

modifyBookmarks f retrieves the current bookmarks, applies f, - and saves them back to file.

modifyBookmarksM :: ([Bookmark] -> HoYoMonad [Bookmark]) -> HoYoMonad () Source #

Helper function twhenever we need to modify the saved bookmarks, - and need access to the hoyo environment.

modifyBookmarks f retrieves the current bookmarks, applies f - in the hoyo environment, and saves them back to file.

Specific command runners

runAdd :: AddOptions -> HoYoMonad () Source #

Run the "add" command: add a new bookmark.

runMove :: MoveOptions -> HoYoMonad () Source #

Run the "move" command: search for a bookmark and cd to it.

runList :: ListOptions -> HoYoMonad () Source #

Run the "list" command: list all the saved bookmarks.

runClear :: ClearOptions -> HoYoMonad () Source #

Run the "clear" command: delete all the saved bookmarks.

runDelete :: DeleteOptions -> HoYoMonad () Source #

Run the "delete" command: search for a bookmark and delete it.

runRefresh :: RefreshOptions -> HoYoMonad () Source #

Run the "refresh" command: re-index bookmarks.

runConfig :: ConfigCommand -> HoYoMonad () Source #

Run the "config" command: dispatch on the given sub-command.

runCheck :: CheckOptions -> FilePath -> FilePath -> IO () Source #

Run the "config check" command: validate the current - config and bookmarks files.

runDefaultCommand :: HoYoMonad () Source #

Run the default command, if it has been specified by the user.

Types

data Options Source #

The final result of parsing the CLI arguments. Contains a command and all - information for that command, and any global options that have been set.

Constructors

Options 

Instances

Instances details
Eq Options Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

(==) :: Options -> Options -> Bool #

(/=) :: Options -> Options -> Bool #

Show Options Source # 
Instance details

Defined in HoYo.Internal.Types

data Command Source #

The core data-type for the hoyo CLI. The Command is parsed from the command-line, - then runCommand dispatches on the type.

Instances

Instances details
Eq Command Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

(==) :: Command -> Command -> Bool #

(/=) :: Command -> Command -> Bool #

Show Command Source # 
Instance details

Defined in HoYo.Internal.Types

data AddOptions Source #

Options for the "add" command to be parsed from the command-line.

Constructors

AddOptions 

Instances

Instances details
Eq AddOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show AddOptions Source # 
Instance details

Defined in HoYo.Internal.Types

newtype MoveOptions Source #

Options for the "move" command to be parsed from the command-line.

Constructors

MoveOptions 

Instances

Instances details
Eq MoveOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show MoveOptions Source # 
Instance details

Defined in HoYo.Internal.Types

data ListOptions Source #

Options for the "list" command to be parsed from the command-line.

Instances

Instances details
Eq ListOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show ListOptions Source # 
Instance details

Defined in HoYo.Internal.Types

data ClearOptions Source #

Options for the "clear" command to be parsed from the command-line.

Constructors

ClearOptions 

Instances

Instances details
Eq ClearOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show ClearOptions Source # 
Instance details

Defined in HoYo.Internal.Types

newtype DeleteOptions Source #

Options for the "delete" command to be parsed from the command-line.

Instances

Instances details
Eq DeleteOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show DeleteOptions Source # 
Instance details

Defined in HoYo.Internal.Types

data RefreshOptions Source #

Options for the "refresh" command to be parsed from the command-line.

Constructors

RefreshOptions 

Instances

Instances details
Eq RefreshOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show RefreshOptions Source # 
Instance details

Defined in HoYo.Internal.Types

data ConfigPrintOptions Source #

Options for the "config print" command to be parsed from the command-line.

Constructors

ConfigPrintOptions 

data ConfigResetOptions Source #

Options for the "config reset" command to be parsed from the command-line.

Constructors

ConfigResetOptions 

data ConfigSetOptions Source #

Options for the "config set" command to be parsed from the command-line.

Constructors

ConfigSetOptions 

Fields

data ConfigAddDefaultOptions Source #

Options for the "config add-default" command to be parsed from the command-line.

data ConfigCommand Source #

Options for the "config" command to be parsed from the command-line.

Instances

Instances details
Eq ConfigCommand Source # 
Instance details

Defined in HoYo.Internal.Types

Show ConfigCommand Source # 
Instance details

Defined in HoYo.Internal.Types

data CheckOptions Source #

Options for the "check" command to be parsed from the command-line.

Constructors

CheckOptions 

Instances

Instances details
Eq CheckOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show CheckOptions Source # 
Instance details

Defined in HoYo.Internal.Types

data GlobalOptions Source #

CLI options that can be set regardless of which command is run.

Instances

Instances details
Eq GlobalOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show GlobalOptions Source # 
Instance details

Defined in HoYo.Internal.Types

defaultGlobalOptions :: GlobalOptions Source #

Default global options. In general this should do nothing.

defaultOverrideOptions :: OverrideOptions Source #

The default behaviour is to override nothing.

overrideConfig :: OverrideOptions -> Config -> Config Source #

Apply the override options to a Config.

overrideEnv :: OverrideOptions -> Env -> Env Source #

Apply the override options to an Env.

verifyOverrides :: OverrideOptions -> Maybe Text Source #

Check that there are no conflicting overrides.

combOverride :: Bool -> Bool -> MaybeOverride Source #

Combine a config flag with a command-line flag, checking for conflicts.

data MaybeOverride Source #

Datatype for representing a command-line settings override.

Instances

Instances details
Eq MaybeOverride Source # 
Instance details

Defined in HoYo.Internal.Types

Show MaybeOverride Source # 
Instance details

Defined in HoYo.Internal.Types

\ No newline at end of file diff --git a/docs/HoYo-Config.html b/docs/HoYo-Config.html deleted file mode 100644 index 538f173..0000000 --- a/docs/HoYo-Config.html +++ /dev/null @@ -1,2 +0,0 @@ -HoYo.Config
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

HoYo.Config

Description

Configuration for the hoyo program. This is stored on-disk as a TOML file, -usually at ~.confighoyo/config.toml

Documentation

data Config Source #

A representation of hoyo settings.

Instances

Instances details
Eq Config Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

(==) :: Config -> Config -> Bool #

(/=) :: Config -> Config -> Bool #

Show Config Source # 
Instance details

Defined in HoYo.Internal.Types

defaultConfig :: Config Source #

The default config for hoyo.

decodeConfig :: Text -> Either Text Config Source #

Decode a Config from a Text.

decodeConfigFile :: MonadIO m => FilePath -> m (Either Text Config) Source #

Decode a Config from a file.

encodeConfig :: Config -> Text Source #

Encode a Config to a Text.

encodeConfigFile :: MonadIO m => FilePath -> Config -> m () Source #

Encode a Config to a file.

setConfig :: MonadError Text m => Text -> Text -> Config -> m Config Source #

Try to set a key-value pair in the config.

getKeyVals :: Config -> [(Text, AnyConfigValue)] Source #

Get TOML key-value pairs from a Config.

\ No newline at end of file diff --git a/docs/HoYo-Env.html b/docs/HoYo-Env.html deleted file mode 100644 index 65f71b4..0000000 --- a/docs/HoYo-Env.html +++ /dev/null @@ -1,3 +0,0 @@ -HoYo.Env
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

HoYo.Env

Description

The read-only hoyo environment.

HoYo config

data Env Source #

The main hoyo read-only environment. Contains the current saved bookmarks, - the current hoyo configuration, and the file locations for each.

Instances

Instances details
Show Env Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

showsPrec :: Int -> Env -> ShowS #

show :: Env -> String #

showList :: [Env] -> ShowS #

MonadReader Env HoYoMonad Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

ask :: HoYoMonad Env #

local :: (Env -> Env) -> HoYoMonad a -> HoYoMonad a #

reader :: (Env -> a) -> HoYoMonad a #

initEnv :: MonadIO m => FilePath -> FilePath -> m () Source #

Given a filepath for the bookmarks file and a filepath for the config file, - initialize the respective TOMLs at those locations.

getEnv :: MonadIO m => FilePath -> FilePath -> m (Either Text Env) Source #

Retrieve an Env from given bookmark- and config- file locations.

writeEnv :: MonadIO m => Env -> m () Source #

Write an Env to file.

readEnv :: MonadIO m => FilePath -> FilePath -> m (Either Text Env) Source #

Read an Env from a file.

Default file paths

defaultBookmarksPath :: IO FilePath Source #

The default path for hoyo bookmarks. Usually $HOME/.local/share/hoyo/config.toml

defaultConfigPath :: IO FilePath Source #

The default path for the hoyo config. Usually $HOME/.config/hoyo/config.toml

\ No newline at end of file diff --git a/docs/HoYo-Internal-Bookmark.html b/docs/HoYo-Internal-Bookmark.html deleted file mode 100644 index f348a7e..0000000 --- a/docs/HoYo-Internal-Bookmark.html +++ /dev/null @@ -1,5 +0,0 @@ -HoYo.Internal.Bookmark
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

HoYo.Internal.Bookmark

Description

Internals used by the HoYo.Bookmark module.

Documentation

bookmarkCodec :: TomlCodec Bookmark Source #

A TomlCodec for encoding and decoding Bookmarks.

encodeBookmarks :: Bookmarks -> Text Source #

Encode a Bookmark to a Text.

encodeBookmarksFile :: MonadIO m => FilePath -> Bookmarks -> m () Source #

Encode a Bookmark to a file.

searchBookmarks :: BookmarkSearchTerm -> Bookmarks -> ([Bookmark], [Bookmark]) Source #

searchBookmarks searchTerm bookmarks partitions bookmarks into a list of - Bookmarks that match the search term and a list of those that do not.

filterBookmarkByName :: Maybe Text -> Bookmark -> Bool Source #

A predicate used by filterBookmarks - match on the bookmark name. - Note that matching is case-sensitive.

filterBookmarkByDirInfix :: Maybe Text -> Bookmark -> Bool Source #

A predicate used by filterBookmarks - match on the bookmark directory.

filterBookmarks :: Maybe Text -> Maybe Text -> Bookmark -> Bool Source #

Given a bookmark name and a bookmark directory, test if a bookmark matches those - filters.

bookmarksFromDefault :: MonadIO m => [DefaultBookmark] -> m Bookmarks Source #

Convert a list of DefaultBookmarks to a Bookmarks, assiging indices and/ - creation times on the fly.

getBookmarks :: HoYoMonad Bookmarks Source #

Get the bookmarks from the currently used bookmark file.

\ No newline at end of file diff --git a/docs/HoYo-Internal-Command.html b/docs/HoYo-Internal-Command.html deleted file mode 100644 index 59c24ba..0000000 --- a/docs/HoYo-Internal-Command.html +++ /dev/null @@ -1,8 +0,0 @@ -HoYo.Internal.Command
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

HoYo.Internal.Command

Description

Internals used by the HoYo.Command module.

Documentation

combOverride :: Bool -> Bool -> MaybeOverride Source #

Combine a config flag with a command-line flag, checking for conflicts.

overrideFunc :: MaybeOverride -> Bool -> Bool Source #

Convert a MaybeOverride to a function on Bool.

overrideConfig :: OverrideOptions -> Config -> Config Source #

Apply the override options to a Config.

overrideEnv :: OverrideOptions -> Env -> Env Source #

Apply the override options to an Env.

verifyOverrides :: OverrideOptions -> Maybe Text Source #

Check that there are no conflicting overrides.

defaultOverrideOptions :: OverrideOptions Source #

The default behaviour is to override nothing.

defaultGlobalOptions :: GlobalOptions Source #

Default global options. In general this should do nothing.

modifyBookmarks :: ([Bookmark] -> [Bookmark]) -> HoYoMonad () Source #

Helper function whenever we need to modify the saved bookmarks.

modifyBookmarks f retrieves the current bookmarks, applies f, - and saves them back to file.

modifyBookmarksM :: ([Bookmark] -> HoYoMonad [Bookmark]) -> HoYoMonad () Source #

Helper function twhenever we need to modify the saved bookmarks, - and need access to the hoyo environment.

modifyBookmarks f retrieves the current bookmarks, applies f - in the hoyo environment, and saves them back to file.

normaliseAndVerifyDirectory :: FilePath -> HoYoMonad FilePath Source #

Normalise a filepath and make sure it's a valid directory.

verifyName :: Text -> HoYoMonad () Source #

Take a name and make sure it's valid.

testNameUnique :: [Bookmark] -> Text -> HoYoMonad Bool Source #

Given the existing bookmarks and a potential bookmark name, - test if the new bookmark will have a unique name.

runAdd :: AddOptions -> HoYoMonad () Source #

Run the "add" command: add a new bookmark.

runMove :: MoveOptions -> HoYoMonad () Source #

Run the "move" command: search for a bookmark and cd to it.

runList :: ListOptions -> HoYoMonad () Source #

Run the "list" command: list all the saved bookmarks.

clearDisabledErrMsg :: Text Source #

Help text displayed when the user tries to run "hoyo clear" - when "enable_clear" is set to false.

resetDisabledErrMsg :: Text Source #

Help text displayed when the user tries to run "hoyo config reset" - when "enable_reset" is set to false.

runClear :: ClearOptions -> HoYoMonad () Source #

Run the "clear" command: delete all the saved bookmarks.

runDelete :: DeleteOptions -> HoYoMonad () Source #

Run the "delete" command: search for a bookmark and delete it.

runRefresh :: RefreshOptions -> HoYoMonad () Source #

Run the "refresh" command: re-index bookmarks.

runConfigPrint :: ConfigPrintOptions -> HoYoMonad () Source #

Run the "config print" command: print the current config.

runConfigReset :: ConfigResetOptions -> HoYoMonad () Source #

Run the "config reset" command: reset the config to defaultConfig.

runConfigSet :: ConfigSetOptions -> HoYoMonad () Source #

Run the "config set" command: try to set a key-value pair in the config.

runAddDefault :: ConfigAddDefaultOptions -> HoYoMonad () Source #

Run the "config add-default" command: try to set a key-value pair in the config.

runConfig :: ConfigCommand -> HoYoMonad () Source #

Run the "config" command: dispatch on the given sub-command.

runCheckConfig :: FilePath -> IO () Source #

Check that the config file is valid.

runCheckBookmarks :: FilePath -> IO () Source #

Check that the bookmarks file is valid.

runCheck :: CheckOptions -> FilePath -> FilePath -> IO () Source #

Run the "config check" command: validate the current - config and bookmarks files.

runDefaultCommand :: HoYoMonad () Source #

Run the default command, if it has been specified by the user.

runHelp :: HelpOptions -> HoYoMonad () Source #

Run the "help" command: get help on a specific subcommand.

runCommand :: Command -> HoYoMonad () Source #

Run a Command in the hoyo environment.

\ No newline at end of file diff --git a/docs/HoYo-Internal-Config.html b/docs/HoYo-Internal-Config.html deleted file mode 100644 index 11115f1..0000000 --- a/docs/HoYo-Internal-Config.html +++ /dev/null @@ -1,3 +0,0 @@ -HoYo.Internal.Config
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

HoYo.Internal.Config

Description

Internals used by the HoYo.Config module.

Documentation

configCodec :: TomlCodec Config Source #

A TOML codec describing how to convert a Config to and from its - TOML representation.

commandCodec :: Key -> TomlCodec Command Source #

Toml codec using optparse-applicative to parse a default command. Incurs a cyclic - dependency which is resolved using Parse.hs-boot.

defaultConfig :: Config Source #

The default config for hoyo.

decodeConfig :: Text -> Either Text Config Source #

Decode a Config from a Text.

decodeConfigFile :: MonadIO m => FilePath -> m (Either Text Config) Source #

Decode a Config from a file.

encodeConfig :: Config -> Text Source #

Encode a Config to a Text.

encodeConfigFile :: MonadIO m => FilePath -> Config -> m () Source #

Encode a Config to a file.

getKeyVals :: Config -> [(Text, AnyConfigValue)] Source #

Get TOML key-value pairs from a Config.

setConfig :: MonadError Text m => Text -> Text -> Config -> m Config Source #

Try to set a key-value pair in the config.

\ No newline at end of file diff --git a/docs/HoYo-Internal-Env.html b/docs/HoYo-Internal-Env.html deleted file mode 100644 index 173c9cf..0000000 --- a/docs/HoYo-Internal-Env.html +++ /dev/null @@ -1,4 +0,0 @@ -HoYo.Internal.Env
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

HoYo.Internal.Env

Description

Internals used by the HoYo.Internal module.

Documentation

writeEnv :: MonadIO m => Env -> m () Source #

Write an Env to file.

readEnv :: MonadIO m => FilePath -> FilePath -> m (Either Text Env) Source #

Read an Env from a file.

initPath :: MonadIO m => FilePath -> m () Source #

Given a file path, make sure that its directory exists.

initEnv :: MonadIO m => FilePath -> FilePath -> m () Source #

Given a filepath for the bookmarks file and a filepath for the config file, - initialize the respective TOMLs at those locations.

initBookmarksIfNotExists :: (MonadIO m, MonadError Text m) => Config -> FilePath -> m Bookmarks Source #

If the bookmarks path doesn't exist, try to create it.

Returns the newly created Bookmarks object, or the result of parsing - the file if it already existed.

initConfigIfNotExists :: (MonadIO m, MonadError Text m) => FilePath -> m Config Source #

If the config path doesn't exist, try to create it.

Returns the newly created Config object, or the result of parsing - the file if it already existed.

initEnvIfNotExists :: (MonadIO m, MonadError Text m) => FilePath -> FilePath -> m Env Source #

If the environment files have not been created yet, do so.

Return the Env object.

getEnv :: MonadIO m => FilePath -> FilePath -> m (Either Text Env) Source #

Retrieve an Env from given bookmark- and config- file locations.

defaultConfigPath :: IO FilePath Source #

The default path for the hoyo config. Usually $HOME/.config/hoyo/config.toml

defaultBookmarksPath :: IO FilePath Source #

The default path for hoyo bookmarks. Usually $HOME/.local/share/hoyo/config.toml

\ No newline at end of file diff --git a/docs/HoYo-Internal-Parse.html b/docs/HoYo-Internal-Parse.html deleted file mode 100644 index f9896f2..0000000 --- a/docs/HoYo-Internal-Parse.html +++ /dev/null @@ -1,16 +0,0 @@ -HoYo.Internal.Parse
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

HoYo.Internal.Parse

Description

Parse CLI arguments.

Documentation

globalOptions :: Parser GlobalOptions Source #

Parse global options: options that can be set on the command line - no matter what sub-command is being run.

For a complete list of the global options, see GlobalOptions or - run hoyo --help.

overrideOptions :: Parser OverrideOptions Source #

Parse override options: options that override config settings. - This can be useful when you want to temporarily enable functionality - for one CLI run, but don't want to change it in the config file.

parseOverride :: Mod FlagFields Bool -> Mod FlagFields Bool -> Parser MaybeOverride Source #

Parse a single override option as a pair of switches. - For example parseOverrideFailOnError is defined as

parseOverrideFailOnError :: Parser MaybeOverride
-parseOverrideFailOnError = parseOverride
-                              (long "fail" <> help "Fail on error")
-                              (long "nofail" <> help "Disable fail on error")
-

and results in the pair of switches:

 --fail                   Fail on error
- --nofail                 Disable fail on error
-

parseOverrideFailOnError :: Parser MaybeOverride Source #

Parse a MaybeOverride corresponding to the "fail_on_error" config option.

parseOverrideDisplayCreationTime :: Parser MaybeOverride Source #

Parse a MaybeOverride corresponding to the "display_creation_time" config option.

parseOverrideEnableClearing :: Parser MaybeOverride Source #

Parse a MaybeOverride corresponding to the "enable_clear" config option.

parseOverrideEnableReset :: Parser MaybeOverride Source #

Parse a MaybeOverride corresponding to the "enable_reset" config option.

parseOverrideBackupBeforeClear :: Parser MaybeOverride Source #

Parse a MaybeOverride corresponding to the "backup_before_clear" config option.

addCommand :: Parser Command Source #

Parse options for the hoyo add command.

bookmarkSearchTerm :: ReadM BookmarkSearchTerm Source #

Parse a BookmarkSearchTerm. First tries to interpret the search term as a number - corresponding to a bookmark index; if that fails, treat the term as a name.

moveCommand :: Parser Command Source #

Parse options for the hoyo move command.

listCommand :: Parser Command Source #

Parse options for the hoyo list command.

clearCommand :: Parser Command Source #

Parse options for the hoyo clear command.

deleteCommand :: Parser Command Source #

Parse options for the hoyo delete command.

refreshCommand :: Parser Command Source #

Parse options for the hoyo refresh command.

configCommand :: Parser Command Source #

Parse options for the hoyo config command.

configPrintCommand :: Parser ConfigCommand Source #

Parse options for the hoyo config print sub-command.

configResetCommand :: Parser ConfigCommand Source #

Parse options for the hoyo config reset sub-command.

configSetCommand :: Parser ConfigCommand Source #

Parse options for the hoyo config set sub-command.

configAddDefaultCommand :: Parser ConfigCommand Source #

Parse options for the hoyo config add-default sub-command.

noArgs :: CheckOptions -> CheckOptions Source #

`hoyo check` should be considered equivalent to `hoyo check --config --bookmarks`

checkCommand :: Parser Command Source #

Parse options for the hoyo check command.

helpCommand :: Parser Command Source #

Parse options for the hoyo help command.

defaultCommand :: Parser Command Source #

If hoyo is run with no arguments, we run the "default command" if it's set.

parseCommand :: Parser Command Source #

Parse a command and the arguments/options for that - command from the command-line arguments.

parseOptions :: Parser Options Source #

Parse an Options argument, which includes the command - to run and any global options.

versionInfo :: String Source #

Version information printed by `hoyo --version`.

versionOption :: Parser (a -> a) Source #

Add a hidden --version flag to the end of a parser.

hoyoFooter :: Chunk Doc Source #

A footer to display at the end of the long help message.

options :: ParserInfo Options Source #

A ParserInfo object containing the necessary information for parsing - CLI commands and arguments, and displaying useful help text.

showHelp :: Maybe String -> IO () Source #

Show the help message. Pass a non-Nothing argument to specify a command.

splitArgs :: Text -> [String] Source #

Split a string into arguments as they would be interpreted on the command line.

Adapted from this StackOverflow comment.

\ No newline at end of file diff --git a/docs/HoYo-Internal-Types.html b/docs/HoYo-Internal-Types.html deleted file mode 100644 index 21a971b..0000000 --- a/docs/HoYo-Internal-Types.html +++ /dev/null @@ -1,11 +0,0 @@ -HoYo.Internal.Types
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

HoYo.Internal.Types

Description

Types used by all the main HoYo.* modules.

Synopsis

Documentation

data Env Source #

The main hoyo read-only environment. Contains the current saved bookmarks, - the current hoyo configuration, and the file locations for each.

Instances

Instances details
Show Env Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

showsPrec :: Int -> Env -> ShowS #

show :: Env -> String #

showList :: [Env] -> ShowS #

MonadReader Env HoYoMonad Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

ask :: HoYoMonad Env #

local :: (Env -> Env) -> HoYoMonad a -> HoYoMonad a #

reader :: (Env -> a) -> HoYoMonad a #

data Bookmark Source #

Bookmark a directory for easy cd. A bookmark remembers the directory, - the index, the creation time, and optionally a user-specified nickname - for the bookmark.

Instances

Instances details
Show Bookmark Source # 
Instance details

Defined in HoYo.Internal.Types

data DefaultBookmark Source #

Default bookmarks to save at init. A default bookmark remembers the directory - and optionally a user-specified nickname for the bookmark.

newtype Bookmarks Source #

Wrapper for [Bookmark].

Constructors

Bookmarks 

Fields

Instances

Instances details
Show Bookmarks Source # 
Instance details

Defined in HoYo.Internal.Types

data BookmarkSearchTerm Source #

Data-type for represting a bookmark search. You can either search - by index or by name. Used by the delete and move commands.

data ConfigValueType Source #

The types of config values allowed in the HoYo config.

data ConfigValue (t :: ConfigValueType) where Source #

Values in the HoYo config. Using a GADT parameterised by ConfigValueType - gives us stricter type safety.

Instances

Instances details
Eq (ConfigValue t) Source # 
Instance details

Defined in HoYo.Internal.Types

Show (ConfigValue t) Source # 
Instance details

Defined in HoYo.Internal.Types

data AnyConfigValue Source #

Existential wrapper around ConfigValue.

Constructors

forall (t :: ConfigValueType). AnyConfigValue (ConfigValue t) 

data Config Source #

A representation of hoyo settings.

Instances

Instances details
Eq Config Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

(==) :: Config -> Config -> Bool #

(/=) :: Config -> Config -> Bool #

Show Config Source # 
Instance details

Defined in HoYo.Internal.Types

newtype HoYoMonad a Source #

HoYoMonad is the main monad stack for the hoyo program. It's essentially a wrapper - around ExceptT T.Text (ReaderT Env IO): in other words, - HoYoMonad a is equivalent to Env -> IO (Either T.Text a)

Constructors

HoYoMonad 

Fields

Instances

Instances details
Monad HoYoMonad Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

(>>=) :: HoYoMonad a -> (a -> HoYoMonad b) -> HoYoMonad b #

(>>) :: HoYoMonad a -> HoYoMonad b -> HoYoMonad b #

return :: a -> HoYoMonad a #

Functor HoYoMonad Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

fmap :: (a -> b) -> HoYoMonad a -> HoYoMonad b #

(<$) :: a -> HoYoMonad b -> HoYoMonad a #

Applicative HoYoMonad Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

pure :: a -> HoYoMonad a #

(<*>) :: HoYoMonad (a -> b) -> HoYoMonad a -> HoYoMonad b #

liftA2 :: (a -> b -> c) -> HoYoMonad a -> HoYoMonad b -> HoYoMonad c #

(*>) :: HoYoMonad a -> HoYoMonad b -> HoYoMonad b #

(<*) :: HoYoMonad a -> HoYoMonad b -> HoYoMonad a #

MonadIO HoYoMonad Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

liftIO :: IO a -> HoYoMonad a #

MonadReader Env HoYoMonad Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

ask :: HoYoMonad Env #

local :: (Env -> Env) -> HoYoMonad a -> HoYoMonad a #

reader :: (Env -> a) -> HoYoMonad a #

MonadError Text HoYoMonad Source # 
Instance details

Defined in HoYo.Internal.Types

data AddOptions Source #

Options for the "add" command to be parsed from the command-line.

Constructors

AddOptions 

Instances

Instances details
Eq AddOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show AddOptions Source # 
Instance details

Defined in HoYo.Internal.Types

newtype MoveOptions Source #

Options for the "move" command to be parsed from the command-line.

Constructors

MoveOptions 

Instances

Instances details
Eq MoveOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show MoveOptions Source # 
Instance details

Defined in HoYo.Internal.Types

data ListOptions Source #

Options for the "list" command to be parsed from the command-line.

Instances

Instances details
Eq ListOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show ListOptions Source # 
Instance details

Defined in HoYo.Internal.Types

data ClearOptions Source #

Options for the "clear" command to be parsed from the command-line.

Constructors

ClearOptions 

Instances

Instances details
Eq ClearOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show ClearOptions Source # 
Instance details

Defined in HoYo.Internal.Types

newtype DeleteOptions Source #

Options for the "delete" command to be parsed from the command-line.

Instances

Instances details
Eq DeleteOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show DeleteOptions Source # 
Instance details

Defined in HoYo.Internal.Types

data RefreshOptions Source #

Options for the "refresh" command to be parsed from the command-line.

Constructors

RefreshOptions 

Instances

Instances details
Eq RefreshOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show RefreshOptions Source # 
Instance details

Defined in HoYo.Internal.Types

data ConfigPrintOptions Source #

Options for the "config print" command to be parsed from the command-line.

Constructors

ConfigPrintOptions 

data ConfigResetOptions Source #

Options for the "config reset" command to be parsed from the command-line.

Constructors

ConfigResetOptions 

data ConfigSetOptions Source #

Options for the "config set" command to be parsed from the command-line.

Constructors

ConfigSetOptions 

Fields

data ConfigAddDefaultOptions Source #

Options for the "config add-default" command to be parsed from the command-line.

data ConfigCommand Source #

Options for the "config" command to be parsed from the command-line.

Instances

Instances details
Eq ConfigCommand Source # 
Instance details

Defined in HoYo.Internal.Types

Show ConfigCommand Source # 
Instance details

Defined in HoYo.Internal.Types

data CheckOptions Source #

Options for the "check" command to be parsed from the command-line.

Constructors

CheckOptions 

Instances

Instances details
Eq CheckOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show CheckOptions Source # 
Instance details

Defined in HoYo.Internal.Types

data Command Source #

The core data-type for the hoyo CLI. The Command is parsed from the command-line, - then runCommand dispatches on the type.

Instances

Instances details
Eq Command Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

(==) :: Command -> Command -> Bool #

(/=) :: Command -> Command -> Bool #

Show Command Source # 
Instance details

Defined in HoYo.Internal.Types

data MaybeOverride Source #

Datatype for representing a command-line settings override.

Instances

Instances details
Eq MaybeOverride Source # 
Instance details

Defined in HoYo.Internal.Types

Show MaybeOverride Source # 
Instance details

Defined in HoYo.Internal.Types

data GlobalOptions Source #

CLI options that can be set regardless of which command is run.

Instances

Instances details
Eq GlobalOptions Source # 
Instance details

Defined in HoYo.Internal.Types

Show GlobalOptions Source # 
Instance details

Defined in HoYo.Internal.Types

data Options Source #

The final result of parsing the CLI arguments. Contains a command and all - information for that command, and any global options that have been set.

Constructors

Options 

Instances

Instances details
Eq Options Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

(==) :: Options -> Options -> Bool #

(/=) :: Options -> Options -> Bool #

Show Options Source # 
Instance details

Defined in HoYo.Internal.Types

\ No newline at end of file diff --git a/docs/HoYo-Internal-Utils.html b/docs/HoYo-Internal-Utils.html deleted file mode 100644 index 1267d4f..0000000 --- a/docs/HoYo-Internal-Utils.html +++ /dev/null @@ -1,9 +0,0 @@ -HoYo.Internal.Utils
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

HoYo.Internal.Utils

Description

Utility functions used by all the main HoYo.* modules.

Documentation

asks' :: MonadReader a m => SimpleGetter a b -> m b Source #

A version of the lens "use" function for MonadReader.

maximumDefault :: Ord a => a -> [a] -> a Source #

Take the maximum of a list, with a default value if the list is empty.

assert :: Text -> HoYoMonad Bool -> HoYoMonad () Source #

Throw an error if a check fails.

assertVerbose :: Text -> HoYoMonad Bool -> HoYoMonad Bool Source #

Throw an error if a check fails AND the "fail_on_error" flag is set.

getBackupFile :: (MonadIO m, MonadError Text m) => FilePath -> String -> m FilePath Source #

Given a file name and an extension, try to find a suitable path for - backing up that file. Used by backupFile.

backupFile :: (MonadIO m, MonadError Text m) => FilePath -> String -> m () Source #

Try to back-up a file. Used when the "backup_before_clear" option is set.

readBool :: MonadError Text m => Text -> m Bool Source #

Try to read a Bool.

readInt :: MonadError Text m => Text -> m Int Source #

Try to read an Int.

printStderr :: MonadIO m => Text -> m () Source #

Print to stderr.

printStdout :: MonadIO m => Text -> m () Source #

Print to stdout.

formatBookmark :: Bool -> Int -> Bookmark -> Text Source #

Format a Bookmark. Used for the "list" command and error reporting - during other commands.

formatBookmark displayTime numberWidth bm returns a pretty representation - of bm, optionally showing the creation time, and padding the index to a - certain width.

formatBookmarks :: Bool -> [Bookmark] -> [Text] Source #

Format a list of Bookmarks. Used for the "list" command and error reporting - during other commands

formatBookmark displayTime bms returns a pretty representation - of bms, optionally showing the creation time, and padding the indices to - line up.

formatDefaultBookmark :: DefaultBookmark -> Text Source #

Format a DefaultBookmark. Used for the "config print" command and error reporting - during other commands.

formatDefaultBookmark bm returns a pretty representation of bm.

tshow :: Show a => a -> Text Source #

Show a value as a Text instead of a String.

formatConfigValue :: AnyConfigValue -> Text Source #

Format a config value. Used for the "config print" command.

\ No newline at end of file diff --git a/docs/HoYo-Internal-Version.html b/docs/HoYo-Internal-Version.html deleted file mode 100644 index e024c03..0000000 --- a/docs/HoYo-Internal-Version.html +++ /dev/null @@ -1 +0,0 @@ -HoYo.Internal.Version
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

HoYo.Internal.Version

Description

This module just exports a string containing the current HoYo version.

Documentation

versionString :: String Source #

The current hoyo version.

\ No newline at end of file diff --git a/docs/HoYo.html b/docs/HoYo.html deleted file mode 100644 index dd07969..0000000 --- a/docs/HoYo.html +++ /dev/null @@ -1,20 +0,0 @@ -HoYo
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

HoYo

Description

hoyo is a command-line utility that lets the user save directories -as bookmarks (similar to in the browser) and easily cd to them.

Synopsis

Bookmarks

data Bookmark Source #

Bookmark a directory for easy cd. A bookmark remembers the directory, - the index, the creation time, and optionally a user-specified nickname - for the bookmark.

Instances

Instances details
Show Bookmark Source # 
Instance details

Defined in HoYo.Internal.Types

newtype Bookmarks Source #

Wrapper for [Bookmark].

Constructors

Bookmarks 

Fields

Instances

Instances details
Show Bookmarks Source # 
Instance details

Defined in HoYo.Internal.Types

searchBookmarks :: BookmarkSearchTerm -> Bookmarks -> ([Bookmark], [Bookmark]) Source #

searchBookmarks searchTerm bookmarks partitions bookmarks into a list of - Bookmarks that match the search term and a list of those that do not.

filterBookmarks :: Maybe Text -> Maybe Text -> Bookmark -> Bool Source #

Given a bookmark name and a bookmark directory, test if a bookmark matches those - filters.

Config

data Config Source #

A representation of hoyo settings.

Instances

Instances details
Eq Config Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

(==) :: Config -> Config -> Bool #

(/=) :: Config -> Config -> Bool #

Show Config Source # 
Instance details

Defined in HoYo.Internal.Types

defaultConfig :: Config Source #

The default config for hoyo.

setConfig :: MonadError Text m => Text -> Text -> Config -> m Config Source #

Try to set a key-value pair in the config.

module HoYo.Env

CLI commands

data Command Source #

The core data-type for the hoyo CLI. The Command is parsed from the command-line, - then runCommand dispatches on the type.

Instances

Instances details
Eq Command Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

(==) :: Command -> Command -> Bool #

(/=) :: Command -> Command -> Bool #

Show Command Source # 
Instance details

Defined in HoYo.Internal.Types

runCommand :: Command -> HoYoMonad () Source #

Run a Command in the hoyo environment.

Utility functions

runHoYo :: HoYoMonad a -> Env -> IO (Either Text a) Source #

Given a hoyo Env, run a monadic action in IO.

withFiles :: GlobalOptions -> FilePath -> FilePath -> HoYoMonad a -> IO (Either Text a) Source #

withFiles globals bFp sFp hoyo gets the environment saved in - the bookmark path (bFp) and the config path (sFp), applies the global - options and overrides in globals, and runs hoyo, returning either - the result or an error message.

getEnvAndRunHoYo :: GlobalOptions -> HoYoMonad a -> FilePath -> FilePath -> IO a Source #

getEnvAndRunHoYo globals hoyo bFp sFp gets the environment saved in - the bookmark path (bFp) and the config path (sFp), applies the global - options and overrides in globals, and runs hoyo, either printing an error - message or discarding the result.

getEnvAndRunCommand :: Options -> FilePath -> FilePath -> IO () Source #

getEnvAndRunHoYo opts bFp sFp gets the environment saved in - the bookmark path (bFp) and the config path (sFp), and runs the command - specified by opts.

data HoYoMonad a Source #

HoYoMonad is the main monad stack for the hoyo program. It's essentially a wrapper - around ExceptT T.Text (ReaderT Env IO): in other words, - HoYoMonad a is equivalent to Env -> IO (Either T.Text a)

Instances

Instances details
Monad HoYoMonad Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

(>>=) :: HoYoMonad a -> (a -> HoYoMonad b) -> HoYoMonad b #

(>>) :: HoYoMonad a -> HoYoMonad b -> HoYoMonad b #

return :: a -> HoYoMonad a #

Functor HoYoMonad Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

fmap :: (a -> b) -> HoYoMonad a -> HoYoMonad b #

(<$) :: a -> HoYoMonad b -> HoYoMonad a #

Applicative HoYoMonad Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

pure :: a -> HoYoMonad a #

(<*>) :: HoYoMonad (a -> b) -> HoYoMonad a -> HoYoMonad b #

liftA2 :: (a -> b -> c) -> HoYoMonad a -> HoYoMonad b -> HoYoMonad c #

(*>) :: HoYoMonad a -> HoYoMonad b -> HoYoMonad b #

(<*) :: HoYoMonad a -> HoYoMonad b -> HoYoMonad a #

MonadIO HoYoMonad Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

liftIO :: IO a -> HoYoMonad a #

MonadReader Env HoYoMonad Source # 
Instance details

Defined in HoYo.Internal.Types

Methods

ask :: HoYoMonad Env #

local :: (Env -> Env) -> HoYoMonad a -> HoYoMonad a #

reader :: (Env -> a) -> HoYoMonad a #

MonadError Text HoYoMonad Source # 
Instance details

Defined in HoYo.Internal.Types

modifyBookmarks :: ([Bookmark] -> [Bookmark]) -> HoYoMonad () Source #

Helper function whenever we need to modify the saved bookmarks.

modifyBookmarks f retrieves the current bookmarks, applies f, - and saves them back to file.

modifyBookmarksM :: ([Bookmark] -> HoYoMonad [Bookmark]) -> HoYoMonad () Source #

Helper function twhenever we need to modify the saved bookmarks, - and need access to the hoyo environment.

modifyBookmarks f retrieves the current bookmarks, applies f - in the hoyo environment, and saves them back to file.

printStderr :: MonadIO m => Text -> m () Source #

Print to stderr.

printStdout :: MonadIO m => Text -> m () Source #

Print to stdout.

readInt :: MonadError Text m => Text -> m Int Source #

Try to read an Int.

readBool :: MonadError Text m => Text -> m Bool Source #

Try to read a Bool.

backupFile :: (MonadIO m, MonadError Text m) => FilePath -> String -> m () Source #

Try to back-up a file. Used when the "backup_before_clear" option is set.

assert :: Text -> HoYoMonad Bool -> HoYoMonad () Source #

Throw an error if a check fails.

assertVerbose :: Text -> HoYoMonad Bool -> HoYoMonad Bool Source #

Throw an error if a check fails AND the "fail_on_error" flag is set.

Misc

versionString :: String Source #

The current hoyo version.

\ No newline at end of file diff --git a/docs/Hoyo-Bookmark.html b/docs/Hoyo-Bookmark.html index f7deace..9cc498b 100644 --- a/docs/Hoyo-Bookmark.html +++ b/docs/Hoyo-Bookmark.html @@ -1,4 +1,4 @@ -Hoyo.Bookmark
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Bookmark

Description

The Bookmark type provides a representation of bookmarks saved and used +Hoyo.Bookmark

hoyo-0.5.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Bookmark

Description

The Bookmark type provides a representation of bookmarks saved and used by the hoyo program. This module exports some utility datatypes and functions used for working with bookmarks.

The Bookmark type

data Bookmark Source #

Bookmark a directory for easy cd. A bookmark remembers the directory, the index, the creation time, and optionally a user-specified nickname diff --git a/docs/Hoyo-CLI-Complete.html b/docs/Hoyo-CLI-Complete.html index da7f689..58824db 100644 --- a/docs/Hoyo-CLI-Complete.html +++ b/docs/Hoyo-CLI-Complete.html @@ -1 +1 @@ -Hoyo.CLI.Complete

hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.CLI.Complete

Description

Bash competion functions used by the CLI.

Documentation

bookmarkCompleter :: Completer Source #

Fetch existing data file and use it to complete bookmark names.

configKeyCompleter :: Completer Source #

Complete configuration keys.

configValueCompleter :: Completer Source #

Complete configuration values.

TODO: could be more sophisticated, considering the current key

\ No newline at end of file +Hoyo.CLI.Complete
hoyo-0.5.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.CLI.Complete

Description

Bash competion functions used by the CLI.

Documentation

bookmarkCompleter :: Completer Source #

Fetch existing data file and use it to complete bookmark names.

configKeyCompleter :: Completer Source #

Complete configuration keys.

configValueCompleter :: Completer Source #

Complete configuration values.

TODO: could be more sophisticated, considering the current key

\ No newline at end of file diff --git a/docs/Hoyo-CLI-Parse.html b/docs/Hoyo-CLI-Parse.html index fefb7ee..8b862fe 100644 --- a/docs/Hoyo-CLI-Parse.html +++ b/docs/Hoyo-CLI-Parse.html @@ -1,4 +1,4 @@ -Hoyo.CLI.Parse
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.CLI.Parse

Description

Parse CLI arguments.

Parsing CLI arguments and options

options :: ParserInfo Options Source #

A ParserInfo object containing the necessary information for parsing +Hoyo.CLI.Parse

hoyo-0.5.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.CLI.Parse

Description

Parse CLI arguments.

Parsing CLI arguments and options

options :: ParserInfo Options Source #

A ParserInfo object containing the necessary information for parsing CLI commands and arguments, and displaying useful help text.

parseOptions :: Parser Options Source #

Parse an Options argument, which includes the command to run and any global options.

parseCommand :: Parser Command Source #

Parse a command and the arguments/options for that command from the command-line arguments.

globalOptions :: Parser GlobalOptions Source #

Parse global options: options that can be set on the command line diff --git a/docs/Hoyo-Command.html b/docs/Hoyo-Command.html index 1c74e48..e31eac2 100644 --- a/docs/Hoyo-Command.html +++ b/docs/Hoyo-Command.html @@ -1,4 +1,4 @@ -Hoyo.Command

hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Command

Description

This module defines data-types and runner functions for the hoyo +Hoyo.Command

hoyo-0.5.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Command

Description

This module defines data-types and runner functions for the hoyo command-line program.

Synopsis

Running CLI commands

runCommand :: Command -> HoyoMonad () Source #

Run a Command in the hoyo environment.

modifyBookmarks :: ([Bookmark] -> [Bookmark]) -> HoyoMonad () Source #

Helper function whenever we need to modify the saved bookmarks.

modifyBookmarks f retrieves the current bookmarks, applies f, and saves them back to file.

modifyBookmarksM :: ([Bookmark] -> HoyoMonad [Bookmark]) -> HoyoMonad () Source #

Helper function twhenever we need to modify the saved bookmarks, and need access to the hoyo environment.

modifyBookmarks f retrieves the current bookmarks, applies f diff --git a/docs/Hoyo-Config.html b/docs/Hoyo-Config.html index 0fa5862..c16ac6b 100644 --- a/docs/Hoyo-Config.html +++ b/docs/Hoyo-Config.html @@ -1,2 +1,2 @@ -Hoyo.Config

hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Config

Description

Configuration for the hoyo program. This is stored on-disk as a TOML file, +Hoyo.Config

hoyo-0.5.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Config

Description

Configuration for the hoyo program. This is stored on-disk as a TOML file, usually at ~.confighoyo/config.toml

Documentation

data Config Source #

A representation of hoyo settings.

Instances

Instances details
Eq Config Source # 
Instance details

Defined in Hoyo.Internal.Types

Methods

(==) :: Config -> Config -> Bool #

(/=) :: Config -> Config -> Bool #

Show Config Source # 
Instance details

Defined in Hoyo.Internal.Types

defaultConfig :: Config Source #

The default config for hoyo.

decodeConfig :: Text -> Either Text Config Source #

Decode a Config from a Text.

decodeConfigFile :: MonadIO m => FilePath -> m (Either Text Config) Source #

Decode a Config from a file.

encodeConfig :: Config -> Text Source #

Encode a Config to a Text.

encodeConfigFile :: MonadIO m => FilePath -> Config -> m () Source #

Encode a Config to a file.

setConfig :: MonadError Text m => Text -> Text -> Config -> m Config Source #

Try to set a key-value pair in the config.

getKeyVals :: Config -> [(Text, AnyConfigValue)] Source #

Get TOML key-value pairs from a Config.

\ No newline at end of file diff --git a/docs/Hoyo-Env.html b/docs/Hoyo-Env.html index cd2fec0..2cb094e 100644 --- a/docs/Hoyo-Env.html +++ b/docs/Hoyo-Env.html @@ -1,3 +1,3 @@ -Hoyo.Env
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Env

Description

The read-only hoyo environment.

Hoyo config

data Env Source #

The main hoyo read-only environment. Contains the current saved bookmarks, +Hoyo.Env

hoyo-0.5.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Env

Description

The read-only hoyo environment.

Hoyo config

data Env Source #

The main hoyo read-only environment. Contains the current saved bookmarks, the current hoyo configuration, and the file locations for each.

Instances

Instances details
Show Env Source # 
Instance details

Defined in Hoyo.Internal.Types

Methods

showsPrec :: Int -> Env -> ShowS #

show :: Env -> String #

showList :: [Env] -> ShowS #

MonadReader Env HoyoMonad Source # 
Instance details

Defined in Hoyo.Internal.Types

Methods

ask :: HoyoMonad Env #

local :: (Env -> Env) -> HoyoMonad a -> HoyoMonad a #

reader :: (Env -> a) -> HoyoMonad a #

initEnv :: MonadIO m => FilePath -> FilePath -> m () Source #

Given a filepath for the bookmarks file and a filepath for the config file, initialize the respective TOMLs at those locations.

getEnv :: MonadIO m => FilePath -> FilePath -> m (Either Text Env) Source #

Retrieve an Env from given bookmark- and config- file locations.

writeEnv :: MonadIO m => Env -> m () Source #

Write an Env to file.

readEnv :: MonadIO m => FilePath -> FilePath -> m (Either Text Env) Source #

Read an Env from a file.

Default file paths

defaultBookmarksPath :: IO FilePath Source #

The default path for hoyo bookmarks. Usually $HOME/.local/share/hoyo/config.toml

defaultConfigPath :: IO FilePath Source #

The default path for the hoyo config. Usually $HOME/.config/hoyo/config.toml

\ No newline at end of file diff --git a/docs/Hoyo-Internal-Bookmark.html b/docs/Hoyo-Internal-Bookmark.html index c46fabd..08a5f3d 100644 --- a/docs/Hoyo-Internal-Bookmark.html +++ b/docs/Hoyo-Internal-Bookmark.html @@ -1,4 +1,4 @@ -Hoyo.Internal.Bookmark
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Bookmark

Description

Internals used by the Hoyo.Bookmark module.

Documentation

bookmarkCodec :: TomlCodec Bookmark Source #

A TomlCodec for encoding and decoding Bookmarks.

encodeBookmarks :: Bookmarks -> Text Source #

Encode a Bookmark to a Text.

encodeBookmarksFile :: MonadIO m => FilePath -> Bookmarks -> m () Source #

Encode a Bookmark to a file.

searchBookmarks :: BookmarkSearchTerm -> Bookmarks -> ([Bookmark], [Bookmark]) Source #

searchBookmarks searchTerm bookmarks partitions bookmarks into a list of +Hoyo.Internal.Bookmark

hoyo-0.5.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Bookmark

Description

Internals used by the Hoyo.Bookmark module.

Documentation

bookmarkCodec :: TomlCodec Bookmark Source #

A TomlCodec for encoding and decoding Bookmarks.

encodeBookmarks :: Bookmarks -> Text Source #

Encode a Bookmark to a Text.

encodeBookmarksFile :: MonadIO m => FilePath -> Bookmarks -> m () Source #

Encode a Bookmark to a file.

searchBookmarks :: BookmarkSearchTerm -> Bookmarks -> ([Bookmark], [Bookmark]) Source #

searchBookmarks searchTerm bookmarks partitions bookmarks into a list of Bookmarks that match the search term and a list of those that do not.

filterBookmarkByName :: Maybe Text -> Bookmark -> Bool Source #

A predicate used by filterBookmarks - match on the bookmark name. Note that matching is case-sensitive.

filterBookmarkByDirInfix :: Maybe Text -> Bookmark -> Bool Source #

A predicate used by filterBookmarks - match on the bookmark directory.

filterBookmarks :: Maybe Text -> Maybe Text -> Bookmark -> Bool Source #

Given a bookmark name and a bookmark directory, test if a bookmark matches those filters.

bookmarksFromDefault :: MonadIO m => [DefaultBookmark] -> m Bookmarks Source #

Convert a list of DefaultBookmarks to a Bookmarks, assiging indices and/ diff --git a/docs/Hoyo-Internal-Command.html b/docs/Hoyo-Internal-Command.html index 66cffed..528ed7d 100644 --- a/docs/Hoyo-Internal-Command.html +++ b/docs/Hoyo-Internal-Command.html @@ -1,4 +1,4 @@ -Hoyo.Internal.Command

hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Command

Description

Internals used by the Hoyo.Command module.

Documentation

combOverride :: Bool -> Bool -> MaybeOverride Source #

Combine a config flag with a command-line flag, checking for conflicts.

overrideFunc :: MaybeOverride -> Bool -> Bool Source #

Convert a MaybeOverride to a function on Bool.

overrideConfig :: OverrideOptions -> Config -> Config Source #

Apply the override options to a Config.

overrideEnv :: OverrideOptions -> Env -> Env Source #

Apply the override options to an Env.

verifyOverrides :: OverrideOptions -> Maybe Text Source #

Check that there are no conflicting overrides.

defaultOverrideOptions :: OverrideOptions Source #

The default behaviour is to override nothing.

defaultGlobalOptions :: GlobalOptions Source #

Default global options. In general this should do nothing.

modifyBookmarks :: ([Bookmark] -> [Bookmark]) -> HoyoMonad () Source #

Helper function whenever we need to modify the saved bookmarks.

modifyBookmarks f retrieves the current bookmarks, applies f, +Hoyo.Internal.Command

hoyo-0.5.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Command

Description

Internals used by the Hoyo.Command module.

Documentation

combOverride :: Bool -> Bool -> MaybeOverride Source #

Combine a config flag with a command-line flag, checking for conflicts.

overrideFunc :: MaybeOverride -> Bool -> Bool Source #

Convert a MaybeOverride to a function on Bool.

overrideConfig :: OverrideOptions -> Config -> Config Source #

Apply the override options to a Config.

overrideEnv :: OverrideOptions -> Env -> Env Source #

Apply the override options to an Env.

verifyOverrides :: OverrideOptions -> Maybe Text Source #

Check that there are no conflicting overrides.

defaultOverrideOptions :: OverrideOptions Source #

The default behaviour is to override nothing.

defaultGlobalOptions :: GlobalOptions Source #

Default global options. In general this should do nothing.

modifyBookmarks :: ([Bookmark] -> [Bookmark]) -> HoyoMonad () Source #

Helper function whenever we need to modify the saved bookmarks.

modifyBookmarks f retrieves the current bookmarks, applies f, and saves them back to file.

modifyBookmarksM :: ([Bookmark] -> HoyoMonad [Bookmark]) -> HoyoMonad () Source #

Helper function twhenever we need to modify the saved bookmarks, and need access to the hoyo environment.

modifyBookmarks f retrieves the current bookmarks, applies f in the hoyo environment, and saves them back to file.

normaliseAndVerifyDirectory :: FilePath -> HoyoMonad FilePath Source #

Normalise a filepath and make sure it's a valid directory.

verifyName :: Text -> HoyoMonad () Source #

Take a name and make sure it's valid.

testNameUnique :: [Bookmark] -> Text -> HoyoMonad Bool Source #

Given the existing bookmarks and a potential bookmark name, diff --git a/docs/Hoyo-Internal-Config.html b/docs/Hoyo-Internal-Config.html index f62de93..a28447d 100644 --- a/docs/Hoyo-Internal-Config.html +++ b/docs/Hoyo-Internal-Config.html @@ -1,3 +1,3 @@ -Hoyo.Internal.Config

hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Config

Description

Internals used by the Hoyo.Config module.

Documentation

configCodec :: TomlCodec Config Source #

A TOML codec describing how to convert a Config to and from its +Hoyo.Internal.Config

hoyo-0.5.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Config

Description

Internals used by the Hoyo.Config module.

Documentation

configCodec :: TomlCodec Config Source #

A TOML codec describing how to convert a Config to and from its TOML representation.

commandCodec :: Key -> TomlCodec Command Source #

Toml codec using optparse-applicative to parse a default command. Incurs a cyclic dependency which is resolved using Parse.hs-boot.

defaultConfig :: Config Source #

The default config for hoyo.

decodeConfig :: Text -> Either Text Config Source #

Decode a Config from a Text.

decodeConfigFile :: MonadIO m => FilePath -> m (Either Text Config) Source #

Decode a Config from a file.

encodeConfig :: Config -> Text Source #

Encode a Config to a Text.

encodeConfigFile :: MonadIO m => FilePath -> Config -> m () Source #

Encode a Config to a file.

getKeyVals :: Config -> [(Text, AnyConfigValue)] Source #

Get TOML key-value pairs from a Config.

setConfig :: MonadError Text m => Text -> Text -> Config -> m Config Source #

Try to set a key-value pair in the config.

\ No newline at end of file diff --git a/docs/Hoyo-Internal-Env.html b/docs/Hoyo-Internal-Env.html index c6cddc2..77efaad 100644 --- a/docs/Hoyo-Internal-Env.html +++ b/docs/Hoyo-Internal-Env.html @@ -1,4 +1,4 @@ -Hoyo.Internal.Env
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Env

Description

Internals used by the Hoyo.Internal module.

Documentation

writeEnv :: MonadIO m => Env -> m () Source #

Write an Env to file.

readEnv :: MonadIO m => FilePath -> FilePath -> m (Either Text Env) Source #

Read an Env from a file.

initPath :: MonadIO m => FilePath -> m () Source #

Given a file path, make sure that its directory exists.

initEnv :: MonadIO m => FilePath -> FilePath -> m () Source #

Given a filepath for the bookmarks file and a filepath for the config file, +Hoyo.Internal.Env

hoyo-0.5.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Env

Description

Internals used by the Hoyo.Internal module.

Documentation

writeEnv :: MonadIO m => Env -> m () Source #

Write an Env to file.

readEnv :: MonadIO m => FilePath -> FilePath -> m (Either Text Env) Source #

Read an Env from a file.

initPath :: MonadIO m => FilePath -> m () Source #

Given a file path, make sure that its directory exists.

initEnv :: MonadIO m => FilePath -> FilePath -> m () Source #

Given a filepath for the bookmarks file and a filepath for the config file, initialize the respective TOMLs at those locations.

initBookmarksIfNotExists :: (MonadIO m, MonadError Text m) => Config -> FilePath -> m Bookmarks Source #

If the bookmarks path doesn't exist, try to create it.

Returns the newly created Bookmarks object, or the result of parsing the file if it already existed.

initConfigIfNotExists :: (MonadIO m, MonadError Text m) => FilePath -> m Config Source #

If the config path doesn't exist, try to create it.

Returns the newly created Config object, or the result of parsing the file if it already existed.

initEnvIfNotExists :: (MonadIO m, MonadError Text m) => FilePath -> FilePath -> m Env Source #

If the environment files have not been created yet, do so.

Return the Env object.

getEnv :: MonadIO m => FilePath -> FilePath -> m (Either Text Env) Source #

Retrieve an Env from given bookmark- and config- file locations.

defaultConfigPath :: IO FilePath Source #

The default path for the hoyo config. Usually $HOME/.config/hoyo/config.toml

defaultBookmarksPath :: IO FilePath Source #

The default path for hoyo bookmarks. Usually $HOME/.local/share/hoyo/config.toml

\ No newline at end of file diff --git a/docs/Hoyo-Internal-Parse.html b/docs/Hoyo-Internal-Parse.html index a6678e1..c35940e 100644 --- a/docs/Hoyo-Internal-Parse.html +++ b/docs/Hoyo-Internal-Parse.html @@ -1,4 +1,4 @@ -Hoyo.Internal.Parse
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Parse

Description

Parse CLI arguments.

Documentation

globalOptions :: Parser GlobalOptions Source #

Parse global options: options that can be set on the command line +Hoyo.Internal.Parse

hoyo-0.5.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Parse

Description

Parse CLI arguments.

Documentation

globalOptions :: Parser GlobalOptions Source #

Parse global options: options that can be set on the command line no matter what sub-command is being run.

For a complete list of the global options, see GlobalOptions or run hoyo --help.

overrideOptions :: Parser OverrideOptions Source #

Parse override options: options that override config settings. This can be useful when you want to temporarily enable functionality diff --git a/docs/Hoyo-Internal-Types.html b/docs/Hoyo-Internal-Types.html index 37a1030..7ae481f 100644 --- a/docs/Hoyo-Internal-Types.html +++ b/docs/Hoyo-Internal-Types.html @@ -1,4 +1,4 @@ -Hoyo.Internal.Types

hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Types

Description

Types used by all the main Hoyo.* modules.

Synopsis

Documentation

data Env Source #

The main hoyo read-only environment. Contains the current saved bookmarks, +Hoyo.Internal.Types

hoyo-0.5.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Types

Description

Types used by all the main Hoyo.* modules.

Synopsis

Documentation

data Env Source #

The main hoyo read-only environment. Contains the current saved bookmarks, the current hoyo configuration, and the file locations for each.

Instances

Instances details
Show Env Source # 
Instance details

Defined in Hoyo.Internal.Types

Methods

showsPrec :: Int -> Env -> ShowS #

show :: Env -> String #

showList :: [Env] -> ShowS #

MonadReader Env HoyoMonad Source # 
Instance details

Defined in Hoyo.Internal.Types

Methods

ask :: HoyoMonad Env #

local :: (Env -> Env) -> HoyoMonad a -> HoyoMonad a #

reader :: (Env -> a) -> HoyoMonad a #

data Bookmark Source #

Bookmark a directory for easy cd. A bookmark remembers the directory, the index, the creation time, and optionally a user-specified nickname for the bookmark.

Instances

Instances details
Show Bookmark Source # 
Instance details

Defined in Hoyo.Internal.Types

data DefaultBookmark Source #

Default bookmarks to save at init. A default bookmark remembers the directory diff --git a/docs/Hoyo-Internal-Utils.html b/docs/Hoyo-Internal-Utils.html index ca97668..c609a04 100644 --- a/docs/Hoyo-Internal-Utils.html +++ b/docs/Hoyo-Internal-Utils.html @@ -1,4 +1,4 @@ -Hoyo.Internal.Utils

hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Utils

Description

Utility functions used by all the main Hoyo.* modules.

Documentation

asks' :: MonadReader a m => SimpleGetter a b -> m b Source #

A version of the lens "use" function for MonadReader.

maximumDefault :: Ord a => a -> [a] -> a Source #

Take the maximum of a list, with a default value if the list is empty.

assert :: Text -> HoyoMonad Bool -> HoyoMonad () Source #

Throw an error if a check fails.

assertVerbose :: Text -> HoyoMonad Bool -> HoyoMonad Bool Source #

Throw an error if a check fails AND the "fail_on_error" flag is set.

getBackupFile :: (MonadIO m, MonadError Text m) => FilePath -> String -> m FilePath Source #

Given a file name and an extension, try to find a suitable path for +Hoyo.Internal.Utils

hoyo-0.5.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Utils

Description

Utility functions used by all the main Hoyo.* modules.

Documentation

asks' :: MonadReader a m => SimpleGetter a b -> m b Source #

A version of the lens "use" function for MonadReader.

maximumDefault :: Ord a => a -> [a] -> a Source #

Take the maximum of a list, with a default value if the list is empty.

assert :: Text -> HoyoMonad Bool -> HoyoMonad () Source #

Throw an error if a check fails.

assertVerbose :: Text -> HoyoMonad Bool -> HoyoMonad Bool Source #

Throw an error if a check fails AND the "fail_on_error" flag is set.

getBackupFile :: (MonadIO m, MonadError Text m) => FilePath -> String -> m FilePath Source #

Given a file name and an extension, try to find a suitable path for backing up that file. Used by backupFile.

backupFile :: (MonadIO m, MonadError Text m) => FilePath -> String -> m () Source #

Try to back-up a file. Used when the "backup_before_clear" option is set.

readBool :: MonadError Text m => Text -> m Bool Source #

Try to read a Bool.

readInt :: MonadError Text m => Text -> m Int Source #

Try to read an Int.

printStderr :: MonadIO m => Text -> m () Source #

Print to stderr.

printStdout :: MonadIO m => Text -> m () Source #

Print to stdout.

formatBookmark :: Bool -> Int -> Int -> Bookmark -> Text Source #

Format a Bookmark. Used for the "list" command and error reporting during other commands.

formatBookmark displayTime numberWidth bm returns a pretty representation of bm, optionally showing the creation time, and padding the index and diff --git a/docs/Hoyo-Internal-Version.html b/docs/Hoyo-Internal-Version.html index 3ef6523..db65cf6 100644 --- a/docs/Hoyo-Internal-Version.html +++ b/docs/Hoyo-Internal-Version.html @@ -1 +1 @@ -Hoyo.Internal.Version

hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Version

Description

This module just exports a string containing the current Hoyo version.

Documentation

versionString :: String Source #

The current hoyo version.

\ No newline at end of file +Hoyo.Internal.Version
hoyo-0.5.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo.Internal.Version

Description

This module just exports a string containing the current Hoyo version.

Documentation

versionString :: String Source #

The current hoyo version.

\ No newline at end of file diff --git a/docs/Hoyo.html b/docs/Hoyo.html index d90aa6c..2f6e7fb 100644 --- a/docs/Hoyo.html +++ b/docs/Hoyo.html @@ -1,4 +1,4 @@ -Hoyo
hoyo-0.4.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo

Description

hoyo is a command-line utility that lets the user save directories +Hoyo

hoyo-0.5.0.0: Bookmark directories for cd
Copyright(c) Frederick Pringle 2023
LicenseBSD-3-Clause
Maintainerfreddyjepringle@gmail.com
Safe HaskellNone
LanguageHaskell2010

Hoyo

Description

hoyo is a command-line utility that lets the user save directories as bookmarks (similar to in the browser) and easily cd to them.

Synopsis

Bookmarks

data Bookmark Source #

Bookmark a directory for easy cd. A bookmark remembers the directory, the index, the creation time, and optionally a user-specified nickname for the bookmark.

Instances

Instances details
Show Bookmark Source # 
Instance details

Defined in Hoyo.Internal.Types

newtype Bookmarks Source #

Wrapper for [Bookmark].

Constructors

Bookmarks 

Fields

Instances

Instances details
Show Bookmarks Source # 
Instance details

Defined in Hoyo.Internal.Types

searchBookmarks :: BookmarkSearchTerm -> Bookmarks -> ([Bookmark], [Bookmark]) Source #

searchBookmarks searchTerm bookmarks partitions bookmarks into a list of diff --git a/docs/doc-index-95.html b/docs/doc-index-95.html index f0f7a40..4c62ce7 100644 --- a/docs/doc-index-95.html +++ b/docs/doc-index-95.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - _)

hoyo-0.4.0.0: Bookmark directories for cd
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - _)
hoyo-0.5.0.0: Bookmark directories for cd
\ No newline at end of file diff --git a/docs/doc-index-A.html b/docs/doc-index-A.html index d682f02..74e2c97 100644 --- a/docs/doc-index-A.html +++ b/docs/doc-index-A.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - A)
hoyo-0.4.0.0: Bookmark directories for cd

Index - A

AddHoyo.Internal.Types, Hoyo.Command, Hoyo
addCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
AddDefaultBookmarkHoyo.Internal.Types, Hoyo.Command, Hoyo
addDefaultDirHoyo.Internal.Types, Hoyo.Command, Hoyo
addDefaultNameHoyo.Internal.Types, Hoyo.Command, Hoyo
addDirectoryHoyo.Internal.Types, Hoyo.Command, Hoyo
addNameHoyo.Internal.Types, Hoyo.Command, Hoyo
AddOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
AnyConfigValue 
1 (Type/Class)Hoyo.Internal.Types
2 (Data Constructor)Hoyo.Internal.Types
asks'Hoyo.Internal.Utils
assertHoyo.Internal.Utils, Hoyo
assertVerboseHoyo.Internal.Utils, Hoyo
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - A)
hoyo-0.5.0.0: Bookmark directories for cd

Index - A

AddHoyo.Internal.Types, Hoyo.Command, Hoyo
addCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
AddDefaultBookmarkHoyo.Internal.Types, Hoyo.Command, Hoyo
addDefaultDirHoyo.Internal.Types, Hoyo.Command, Hoyo
addDefaultNameHoyo.Internal.Types, Hoyo.Command, Hoyo
addDirectoryHoyo.Internal.Types, Hoyo.Command, Hoyo
addNameHoyo.Internal.Types, Hoyo.Command, Hoyo
AddOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
AnyConfigValue 
1 (Type/Class)Hoyo.Internal.Types
2 (Data Constructor)Hoyo.Internal.Types
asks'Hoyo.Internal.Utils
assertHoyo.Internal.Utils, Hoyo
assertVerboseHoyo.Internal.Utils, Hoyo
\ No newline at end of file diff --git a/docs/doc-index-All.html b/docs/doc-index-All.html index 8e910e2..26b0da4 100644 --- a/docs/doc-index-All.html +++ b/docs/doc-index-All.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index)
hoyo-0.4.0.0: Bookmark directories for cd

Index

AddHoyo.Internal.Types, Hoyo.Command, Hoyo
addCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
AddDefaultBookmarkHoyo.Internal.Types, Hoyo.Command, Hoyo
addDefaultDirHoyo.Internal.Types, Hoyo.Command, Hoyo
addDefaultNameHoyo.Internal.Types, Hoyo.Command, Hoyo
addDirectoryHoyo.Internal.Types, Hoyo.Command, Hoyo
addNameHoyo.Internal.Types, Hoyo.Command, Hoyo
AddOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
AnyConfigValue 
1 (Type/Class)Hoyo.Internal.Types
2 (Data Constructor)Hoyo.Internal.Types
asks'Hoyo.Internal.Utils
assertHoyo.Internal.Utils, Hoyo
assertVerboseHoyo.Internal.Utils, Hoyo
backupBeforeClearHoyo.Internal.Utils
backupFileHoyo.Internal.Utils, Hoyo
Bookmark 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
bookmarkCodecHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
bookmarkCompleterHoyo.CLI.Complete
bookmarkCreationTimeHoyo.Internal.Types
bookmarkDirectoryHoyo.Internal.Types
bookmarkIndexHoyo.Internal.Types
bookmarkNameHoyo.Internal.Types
Bookmarks 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
bookmarksHoyo.Internal.Types
bookmarksCodecHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
BookmarkSearchTermHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
bookmarkSearchTermHoyo.Internal.Parse
bookmarksFromDefaultHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
bookmarksPathHoyo.Internal.Types
BoolVHoyo.Internal.Types
CheckHoyo.Internal.Types, Hoyo.Command, Hoyo
checkBookmarksHoyo.Internal.Types, Hoyo.Command, Hoyo
checkCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
checkConfigHoyo.Internal.Types, Hoyo.Command, Hoyo
CheckOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
ClearHoyo.Internal.Types, Hoyo.Command, Hoyo
clearCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
clearDisabledErrMsgHoyo.Internal.Command
ClearOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
combOverrideHoyo.Internal.Command, Hoyo.Command, Hoyo
CommandHoyo.Internal.Types, Hoyo.Command, Hoyo
commandCodecHoyo.Internal.Config
CommandVHoyo.Internal.Types
Config 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Config, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Config, Hoyo
configHoyo.Internal.Types
configAddDefaultCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigAddDefaultOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
ConfigCmdHoyo.Internal.Types, Hoyo.Command, Hoyo
configCodecHoyo.Internal.Config
ConfigCommandHoyo.Internal.Types, Hoyo.Command, Hoyo
configCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
configKeyCompleterHoyo.CLI.Complete
configPathHoyo.Internal.Types
configPrintCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigPrintOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
configResetCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigResetOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
configSetCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigSetOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
ConfigValueHoyo.Internal.Types
configValueCompleterHoyo.CLI.Complete
ConfigValueTypeHoyo.Internal.Types
ConflictHoyo.Internal.Types, Hoyo.Command, Hoyo
dataPathHoyo.Internal.Types, Hoyo.Command, Hoyo
decodeBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
decodeBookmarksFileHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
decodeConfigHoyo.Internal.Config, Hoyo.Config, Hoyo
decodeConfigFileHoyo.Internal.Config, Hoyo.Config, Hoyo
DefaultBookmark 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
defaultBookmarkCodecHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
defaultBookmarkDirectoryHoyo.Internal.Types
defaultBookmarkNameHoyo.Internal.Types
defaultBookmarksHoyo.Internal.Utils
defaultBookmarksPathHoyo.Internal.Env, Hoyo.Env, Hoyo
DefaultBookmarkVHoyo.Internal.Types
DefaultCommandHoyo.Internal.Types, Hoyo.Command, Hoyo
defaultCommand 
1 (Function)Hoyo.Internal.Utils
2 (Function)Hoyo.Internal.Parse, Hoyo.CLI.Parse
defaultConfigHoyo.Internal.Config, Hoyo.Config, Hoyo
defaultConfigPathHoyo.Internal.Env, Hoyo.Env, Hoyo
defaultGlobalOptionsHoyo.Internal.Command, Hoyo.Command, Hoyo
defaultOverrideOptionsHoyo.Internal.Command, Hoyo.Command, Hoyo
DeleteHoyo.Internal.Types, Hoyo.Command, Hoyo
deleteCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
DeleteOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
deleteSearchHoyo.Internal.Types, Hoyo.Command, Hoyo
displayCreationTimeHoyo.Internal.Utils
enableClearingHoyo.Internal.Utils
enableResetHoyo.Internal.Utils
encodeBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
encodeBookmarksFileHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
encodeConfigHoyo.Internal.Config, Hoyo.Config, Hoyo
encodeConfigFileHoyo.Internal.Config, Hoyo.Config, Hoyo
Env 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Env, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Env, Hoyo
failOnErrorHoyo.Internal.Utils
filterBookmarkByDirInfixHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
filterBookmarkByNameHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
filterBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
formatArgsHoyo.Internal.Utils
formatBookmarkHoyo.Internal.Utils, Hoyo.Bookmark, Hoyo
formatBookmarksHoyo.Internal.Utils, Hoyo.Bookmark, Hoyo
formatBookmarkSearchTermHoyo.Internal.Utils
formatCommandHoyo.Internal.Utils
formatConfigCommandHoyo.Internal.Utils
formatConfigValueHoyo.Internal.Utils
formatDefaultBookmarkHoyo.Internal.Utils
formatGlobalsHoyo.Internal.Utils
formatOptionsHoyo.Internal.Utils
formatOverrideHoyo.Internal.Utils
formatOverridesHoyo.Internal.Utils
formatSearchTermHoyo.Internal.Utils
getBackupFileHoyo.Internal.Utils
getBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
getBoolHoyo.Internal.Utils
getCommandHoyo.Internal.Utils
getDefaultBookmarkHoyo.Internal.Utils
getEnvHoyo.Internal.Env, Hoyo.Env, Hoyo
getEnvAndRunCommandHoyo
getEnvAndRunHoyoHoyo
getKeyValsHoyo.Internal.Config, Hoyo.Config, Hoyo
getListHoyo.Internal.Utils
getMaybeHoyo.Internal.Utils
globalConfigPathHoyo.Internal.Types, Hoyo.Command, Hoyo
GlobalOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
globalOptionsHoyo.Internal.Parse, Hoyo.CLI.Parse
HelpHoyo.Internal.Types, Hoyo.Command, Hoyo
helpCommandHoyo.Internal.Parse
HelpOptions 
1 (Type/Class)Hoyo.Internal.Types
2 (Data Constructor)Hoyo.Internal.Types
helpSubcommandHoyo.Internal.Types
hoyoFooterHoyo.Internal.Parse
HoyoMonad 
1 (Type/Class)Hoyo.Internal.Types, Hoyo
2 (Data Constructor)Hoyo.Internal.Types
initBookmarksIfNotExistsHoyo.Internal.Env
initConfigIfNotExistsHoyo.Internal.Env
initEnvHoyo.Internal.Env, Hoyo.Env, Hoyo
initEnvIfNotExistsHoyo.Internal.Env
initPathHoyo.Internal.Env
ListHoyo.Internal.Types, Hoyo.Command, Hoyo
listCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
listFilterDirectoryInfixHoyo.Internal.Types, Hoyo.Command, Hoyo
listFilterNameHoyo.Internal.Types, Hoyo.Command, Hoyo
ListOfVHoyo.Internal.Types
ListOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
maximumDefaultHoyo.Internal.Utils
MaybeOverrideHoyo.Internal.Types, Hoyo.Command, Hoyo
maybeSingletonHoyo.Internal.Utils
maybeSingletonWithPrefixHoyo.Internal.Utils
MaybeVHoyo.Internal.Types
modifyBookmarksHoyo.Internal.Command, Hoyo.Command, Hoyo
modifyBookmarksMHoyo.Internal.Command, Hoyo.Command, Hoyo
MoveHoyo.Internal.Types, Hoyo.Command, Hoyo
moveCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
MoveOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
moveSearchHoyo.Internal.Types, Hoyo.Command, Hoyo
noArgsHoyo.Internal.Parse
NoOverrideHoyo.Internal.Types, Hoyo.Command, Hoyo
normaliseAndVerifyDirectoryHoyo.Internal.Command
optCommandHoyo.Internal.Types, Hoyo.Command, Hoyo
optGlobalsHoyo.Internal.Types, Hoyo.Command, Hoyo
Options 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
optionsHoyo.Internal.Parse, Hoyo.CLI.Parse
overrideBackupBeforeClearHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideConfigHoyo.Internal.Command, Hoyo.Command, Hoyo
overrideDisplayCreationTimeHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideEnableClearingHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideEnableResetHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideEnvHoyo.Internal.Command, Hoyo.Command, Hoyo
overrideFailOnErrorHoyo.Internal.Types, Hoyo.Command, Hoyo
OverrideFalseHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideFuncHoyo.Internal.Command
OverrideOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
overrideOptionsHoyo.Internal.Parse, Hoyo.CLI.Parse
overridesHoyo.Internal.Types, Hoyo.Command, Hoyo
OverrideTrueHoyo.Internal.Types, Hoyo.Command, Hoyo
parseCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
parseOptionsHoyo.Internal.Parse, Hoyo.CLI.Parse
parseOverrideHoyo.Internal.Parse
parseOverrideBackupBeforeClearHoyo.Internal.Parse
parseOverrideDisplayCreationTimeHoyo.Internal.Parse
parseOverrideEnableClearingHoyo.Internal.Parse
parseOverrideEnableResetHoyo.Internal.Parse
parseOverrideFailOnErrorHoyo.Internal.Parse
PrintHoyo.Internal.Types, Hoyo.Command, Hoyo
printStderrHoyo.Internal.Utils, Hoyo
printStdoutHoyo.Internal.Utils, Hoyo
readBoolHoyo.Internal.Utils, Hoyo
readEnvHoyo.Internal.Env, Hoyo.Env, Hoyo
readIntHoyo.Internal.Utils, Hoyo
RefreshHoyo.Internal.Types, Hoyo.Command, Hoyo
refreshCommandHoyo.Internal.Parse
RefreshOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
ResetHoyo.Internal.Types, Hoyo.Command, Hoyo
resetDisabledErrMsgHoyo.Internal.Command
runAddHoyo.Internal.Command, Hoyo.Command, Hoyo
runAddDefaultHoyo.Internal.Command
runCheckHoyo.Internal.Command, Hoyo.Command, Hoyo
runCheckBookmarksHoyo.Internal.Command
runCheckConfigHoyo.Internal.Command
runClearHoyo.Internal.Command, Hoyo.Command, Hoyo
runCommandHoyo.Internal.Command, Hoyo.Command, Hoyo
runConfigHoyo.Internal.Command, Hoyo.Command, Hoyo
runConfigPrintHoyo.Internal.Command
runConfigResetHoyo.Internal.Command
runConfigSetHoyo.Internal.Command
runDefaultCommandHoyo.Internal.Command, Hoyo.Command, Hoyo
runDeleteHoyo.Internal.Command, Hoyo.Command, Hoyo
runHelpHoyo.Internal.Command
runHoyoHoyo
runListHoyo.Internal.Command, Hoyo.Command, Hoyo
runMoveHoyo.Internal.Command, Hoyo.Command, Hoyo
runRefreshHoyo.Internal.Command, Hoyo.Command, Hoyo
searchBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
SearchIndexHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
SearchNameHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
SetHoyo.Internal.Types, Hoyo.Command, Hoyo
setBoolHoyo.Internal.Utils
setCommandHoyo.Internal.Utils
setConfigHoyo.Internal.Config, Hoyo.Config, Hoyo
setDefaultBookmarkHoyo.Internal.Utils
setKeyHoyo.Internal.Types, Hoyo.Command, Hoyo
setListHoyo.Internal.Utils
setMaybeHoyo.Internal.Utils
setValueHoyo.Internal.Types, Hoyo.Command, Hoyo
showHelpHoyo.Internal.Parse
singletonHoyo.Internal.Utils
splitArgsHoyo.Internal.Parse, Hoyo.CLI.Parse
TBoolHoyo.Internal.Types
TCommandHoyo.Internal.Types
TDefaultBookmarkHoyo.Internal.Types
testNameUniqueHoyo.Internal.Command
TListHoyo.Internal.Types
TMaybeHoyo.Internal.Types
tshowHoyo.Internal.Utils
unBookmarksHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
unHoyoHoyo.Internal.Types
verifyNameHoyo.Internal.Command
verifyOverridesHoyo.Internal.Command, Hoyo.Command, Hoyo
versionInfoHoyo.Internal.Parse
versionOptionHoyo.Internal.Parse
versionStringHoyo.Internal.Version, Hoyo
withFilesHoyo
writeEnvHoyo.Internal.Env, Hoyo.Env, Hoyo
_backupBeforeClearHoyo.Internal.Types, Hoyo.Config, Hoyo
_bookmarkCreationTimeHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
_bookmarkDirectoryHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
_bookmarkIndexHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
_bookmarkNameHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
_bookmarksHoyo.Internal.Types, Hoyo.Env, Hoyo
_bookmarksPathHoyo.Internal.Types, Hoyo.Env, Hoyo
_configHoyo.Internal.Types, Hoyo.Env, Hoyo
_configPathHoyo.Internal.Types, Hoyo.Env, Hoyo
_defaultBookmarkDirectoryHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
_defaultBookmarkNameHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
_defaultBookmarksHoyo.Internal.Types, Hoyo.Config, Hoyo
_defaultCommandHoyo.Internal.Types, Hoyo.Config, Hoyo
_displayCreationTimeHoyo.Internal.Types, Hoyo.Config, Hoyo
_enableClearingHoyo.Internal.Types, Hoyo.Config, Hoyo
_enableResetHoyo.Internal.Types, Hoyo.Config, Hoyo
_failOnErrorHoyo.Internal.Types, Hoyo.Config, Hoyo
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index)
hoyo-0.5.0.0: Bookmark directories for cd

Index

AddHoyo.Internal.Types, Hoyo.Command, Hoyo
addCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
AddDefaultBookmarkHoyo.Internal.Types, Hoyo.Command, Hoyo
addDefaultDirHoyo.Internal.Types, Hoyo.Command, Hoyo
addDefaultNameHoyo.Internal.Types, Hoyo.Command, Hoyo
addDirectoryHoyo.Internal.Types, Hoyo.Command, Hoyo
addNameHoyo.Internal.Types, Hoyo.Command, Hoyo
AddOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
AnyConfigValue 
1 (Type/Class)Hoyo.Internal.Types
2 (Data Constructor)Hoyo.Internal.Types
asks'Hoyo.Internal.Utils
assertHoyo.Internal.Utils, Hoyo
assertVerboseHoyo.Internal.Utils, Hoyo
backupBeforeClearHoyo.Internal.Utils
backupFileHoyo.Internal.Utils, Hoyo
Bookmark 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
bookmarkCodecHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
bookmarkCompleterHoyo.CLI.Complete
bookmarkCreationTimeHoyo.Internal.Types
bookmarkDirectoryHoyo.Internal.Types
bookmarkIndexHoyo.Internal.Types
bookmarkNameHoyo.Internal.Types
Bookmarks 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
bookmarksHoyo.Internal.Types
bookmarksCodecHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
BookmarkSearchTermHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
bookmarkSearchTermHoyo.Internal.Parse
bookmarksFromDefaultHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
bookmarksPathHoyo.Internal.Types
BoolVHoyo.Internal.Types
CheckHoyo.Internal.Types, Hoyo.Command, Hoyo
checkBookmarksHoyo.Internal.Types, Hoyo.Command, Hoyo
checkCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
checkConfigHoyo.Internal.Types, Hoyo.Command, Hoyo
CheckOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
ClearHoyo.Internal.Types, Hoyo.Command, Hoyo
clearCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
clearDisabledErrMsgHoyo.Internal.Command
ClearOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
combOverrideHoyo.Internal.Command, Hoyo.Command, Hoyo
CommandHoyo.Internal.Types, Hoyo.Command, Hoyo
commandCodecHoyo.Internal.Config
CommandVHoyo.Internal.Types
Config 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Config, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Config, Hoyo
configHoyo.Internal.Types
configAddDefaultCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigAddDefaultOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
ConfigCmdHoyo.Internal.Types, Hoyo.Command, Hoyo
configCodecHoyo.Internal.Config
ConfigCommandHoyo.Internal.Types, Hoyo.Command, Hoyo
configCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
configKeyCompleterHoyo.CLI.Complete
configPathHoyo.Internal.Types
configPrintCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigPrintOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
configResetCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigResetOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
configSetCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigSetOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
ConfigValueHoyo.Internal.Types
configValueCompleterHoyo.CLI.Complete
ConfigValueTypeHoyo.Internal.Types
ConflictHoyo.Internal.Types, Hoyo.Command, Hoyo
dataPathHoyo.Internal.Types, Hoyo.Command, Hoyo
decodeBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
decodeBookmarksFileHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
decodeConfigHoyo.Internal.Config, Hoyo.Config, Hoyo
decodeConfigFileHoyo.Internal.Config, Hoyo.Config, Hoyo
DefaultBookmark 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
defaultBookmarkCodecHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
defaultBookmarkDirectoryHoyo.Internal.Types
defaultBookmarkNameHoyo.Internal.Types
defaultBookmarksHoyo.Internal.Utils
defaultBookmarksPathHoyo.Internal.Env, Hoyo.Env, Hoyo
DefaultBookmarkVHoyo.Internal.Types
DefaultCommandHoyo.Internal.Types, Hoyo.Command, Hoyo
defaultCommand 
1 (Function)Hoyo.Internal.Utils
2 (Function)Hoyo.Internal.Parse, Hoyo.CLI.Parse
defaultConfigHoyo.Internal.Config, Hoyo.Config, Hoyo
defaultConfigPathHoyo.Internal.Env, Hoyo.Env, Hoyo
defaultGlobalOptionsHoyo.Internal.Command, Hoyo.Command, Hoyo
defaultOverrideOptionsHoyo.Internal.Command, Hoyo.Command, Hoyo
DeleteHoyo.Internal.Types, Hoyo.Command, Hoyo
deleteCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
DeleteOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
deleteSearchHoyo.Internal.Types, Hoyo.Command, Hoyo
displayCreationTimeHoyo.Internal.Utils
enableClearingHoyo.Internal.Utils
enableResetHoyo.Internal.Utils
encodeBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
encodeBookmarksFileHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
encodeConfigHoyo.Internal.Config, Hoyo.Config, Hoyo
encodeConfigFileHoyo.Internal.Config, Hoyo.Config, Hoyo
Env 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Env, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Env, Hoyo
failOnErrorHoyo.Internal.Utils
filterBookmarkByDirInfixHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
filterBookmarkByNameHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
filterBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
formatArgsHoyo.Internal.Utils
formatBookmarkHoyo.Internal.Utils, Hoyo.Bookmark, Hoyo
formatBookmarksHoyo.Internal.Utils, Hoyo.Bookmark, Hoyo
formatBookmarkSearchTermHoyo.Internal.Utils
formatCommandHoyo.Internal.Utils
formatConfigCommandHoyo.Internal.Utils
formatConfigValueHoyo.Internal.Utils
formatDefaultBookmarkHoyo.Internal.Utils
formatGlobalsHoyo.Internal.Utils
formatOptionsHoyo.Internal.Utils
formatOverrideHoyo.Internal.Utils
formatOverridesHoyo.Internal.Utils
formatSearchTermHoyo.Internal.Utils
getBackupFileHoyo.Internal.Utils
getBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
getBoolHoyo.Internal.Utils
getCommandHoyo.Internal.Utils
getDefaultBookmarkHoyo.Internal.Utils
getEnvHoyo.Internal.Env, Hoyo.Env, Hoyo
getEnvAndRunCommandHoyo
getEnvAndRunHoyoHoyo
getKeyValsHoyo.Internal.Config, Hoyo.Config, Hoyo
getListHoyo.Internal.Utils
getMaybeHoyo.Internal.Utils
globalConfigPathHoyo.Internal.Types, Hoyo.Command, Hoyo
GlobalOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
globalOptionsHoyo.Internal.Parse, Hoyo.CLI.Parse
HelpHoyo.Internal.Types, Hoyo.Command, Hoyo
helpCommandHoyo.Internal.Parse
HelpOptions 
1 (Type/Class)Hoyo.Internal.Types
2 (Data Constructor)Hoyo.Internal.Types
helpSubcommandHoyo.Internal.Types
hoyoFooterHoyo.Internal.Parse
HoyoMonad 
1 (Type/Class)Hoyo.Internal.Types, Hoyo
2 (Data Constructor)Hoyo.Internal.Types
initBookmarksIfNotExistsHoyo.Internal.Env
initConfigIfNotExistsHoyo.Internal.Env
initEnvHoyo.Internal.Env, Hoyo.Env, Hoyo
initEnvIfNotExistsHoyo.Internal.Env
initPathHoyo.Internal.Env
ListHoyo.Internal.Types, Hoyo.Command, Hoyo
listCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
listFilterDirectoryInfixHoyo.Internal.Types, Hoyo.Command, Hoyo
listFilterNameHoyo.Internal.Types, Hoyo.Command, Hoyo
ListOfVHoyo.Internal.Types
ListOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
maximumDefaultHoyo.Internal.Utils
MaybeOverrideHoyo.Internal.Types, Hoyo.Command, Hoyo
maybeSingletonHoyo.Internal.Utils
maybeSingletonWithPrefixHoyo.Internal.Utils
MaybeVHoyo.Internal.Types
modifyBookmarksHoyo.Internal.Command, Hoyo.Command, Hoyo
modifyBookmarksMHoyo.Internal.Command, Hoyo.Command, Hoyo
MoveHoyo.Internal.Types, Hoyo.Command, Hoyo
moveCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
MoveOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
moveSearchHoyo.Internal.Types, Hoyo.Command, Hoyo
noArgsHoyo.Internal.Parse
NoOverrideHoyo.Internal.Types, Hoyo.Command, Hoyo
normaliseAndVerifyDirectoryHoyo.Internal.Command
optCommandHoyo.Internal.Types, Hoyo.Command, Hoyo
optGlobalsHoyo.Internal.Types, Hoyo.Command, Hoyo
Options 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
optionsHoyo.Internal.Parse, Hoyo.CLI.Parse
overrideBackupBeforeClearHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideConfigHoyo.Internal.Command, Hoyo.Command, Hoyo
overrideDisplayCreationTimeHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideEnableClearingHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideEnableResetHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideEnvHoyo.Internal.Command, Hoyo.Command, Hoyo
overrideFailOnErrorHoyo.Internal.Types, Hoyo.Command, Hoyo
OverrideFalseHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideFuncHoyo.Internal.Command
OverrideOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
overrideOptionsHoyo.Internal.Parse, Hoyo.CLI.Parse
overridesHoyo.Internal.Types, Hoyo.Command, Hoyo
OverrideTrueHoyo.Internal.Types, Hoyo.Command, Hoyo
parseCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
parseOptionsHoyo.Internal.Parse, Hoyo.CLI.Parse
parseOverrideHoyo.Internal.Parse
parseOverrideBackupBeforeClearHoyo.Internal.Parse
parseOverrideDisplayCreationTimeHoyo.Internal.Parse
parseOverrideEnableClearingHoyo.Internal.Parse
parseOverrideEnableResetHoyo.Internal.Parse
parseOverrideFailOnErrorHoyo.Internal.Parse
PrintHoyo.Internal.Types, Hoyo.Command, Hoyo
printStderrHoyo.Internal.Utils, Hoyo
printStdoutHoyo.Internal.Utils, Hoyo
readBoolHoyo.Internal.Utils, Hoyo
readEnvHoyo.Internal.Env, Hoyo.Env, Hoyo
readIntHoyo.Internal.Utils, Hoyo
RefreshHoyo.Internal.Types, Hoyo.Command, Hoyo
refreshCommandHoyo.Internal.Parse
RefreshOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
ResetHoyo.Internal.Types, Hoyo.Command, Hoyo
resetDisabledErrMsgHoyo.Internal.Command
runAddHoyo.Internal.Command, Hoyo.Command, Hoyo
runAddDefaultHoyo.Internal.Command
runCheckHoyo.Internal.Command, Hoyo.Command, Hoyo
runCheckBookmarksHoyo.Internal.Command
runCheckConfigHoyo.Internal.Command
runClearHoyo.Internal.Command, Hoyo.Command, Hoyo
runCommandHoyo.Internal.Command, Hoyo.Command, Hoyo
runConfigHoyo.Internal.Command, Hoyo.Command, Hoyo
runConfigPrintHoyo.Internal.Command
runConfigResetHoyo.Internal.Command
runConfigSetHoyo.Internal.Command
runDefaultCommandHoyo.Internal.Command, Hoyo.Command, Hoyo
runDeleteHoyo.Internal.Command, Hoyo.Command, Hoyo
runHelpHoyo.Internal.Command
runHoyoHoyo
runListHoyo.Internal.Command, Hoyo.Command, Hoyo
runMoveHoyo.Internal.Command, Hoyo.Command, Hoyo
runRefreshHoyo.Internal.Command, Hoyo.Command, Hoyo
searchBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
SearchIndexHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
SearchNameHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
SetHoyo.Internal.Types, Hoyo.Command, Hoyo
setBoolHoyo.Internal.Utils
setCommandHoyo.Internal.Utils
setConfigHoyo.Internal.Config, Hoyo.Config, Hoyo
setDefaultBookmarkHoyo.Internal.Utils
setKeyHoyo.Internal.Types, Hoyo.Command, Hoyo
setListHoyo.Internal.Utils
setMaybeHoyo.Internal.Utils
setValueHoyo.Internal.Types, Hoyo.Command, Hoyo
showHelpHoyo.Internal.Parse
singletonHoyo.Internal.Utils
splitArgsHoyo.Internal.Parse, Hoyo.CLI.Parse
TBoolHoyo.Internal.Types
TCommandHoyo.Internal.Types
TDefaultBookmarkHoyo.Internal.Types
testNameUniqueHoyo.Internal.Command
TListHoyo.Internal.Types
TMaybeHoyo.Internal.Types
tshowHoyo.Internal.Utils
unBookmarksHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
unHoyoHoyo.Internal.Types
verifyNameHoyo.Internal.Command
verifyOverridesHoyo.Internal.Command, Hoyo.Command, Hoyo
versionInfoHoyo.Internal.Parse
versionOptionHoyo.Internal.Parse
versionStringHoyo.Internal.Version, Hoyo
withFilesHoyo
writeEnvHoyo.Internal.Env, Hoyo.Env, Hoyo
_backupBeforeClearHoyo.Internal.Types, Hoyo.Config, Hoyo
_bookmarkCreationTimeHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
_bookmarkDirectoryHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
_bookmarkIndexHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
_bookmarkNameHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
_bookmarksHoyo.Internal.Types, Hoyo.Env, Hoyo
_bookmarksPathHoyo.Internal.Types, Hoyo.Env, Hoyo
_configHoyo.Internal.Types, Hoyo.Env, Hoyo
_configPathHoyo.Internal.Types, Hoyo.Env, Hoyo
_defaultBookmarkDirectoryHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
_defaultBookmarkNameHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
_defaultBookmarksHoyo.Internal.Types, Hoyo.Config, Hoyo
_defaultCommandHoyo.Internal.Types, Hoyo.Config, Hoyo
_displayCreationTimeHoyo.Internal.Types, Hoyo.Config, Hoyo
_enableClearingHoyo.Internal.Types, Hoyo.Config, Hoyo
_enableResetHoyo.Internal.Types, Hoyo.Config, Hoyo
_failOnErrorHoyo.Internal.Types, Hoyo.Config, Hoyo
\ No newline at end of file diff --git a/docs/doc-index-B.html b/docs/doc-index-B.html index 5580b0b..e2ba7bd 100644 --- a/docs/doc-index-B.html +++ b/docs/doc-index-B.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - B)
hoyo-0.4.0.0: Bookmark directories for cd

Index - B

backupBeforeClearHoyo.Internal.Utils
backupFileHoyo.Internal.Utils, Hoyo
Bookmark 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
bookmarkCodecHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
bookmarkCompleterHoyo.CLI.Complete
bookmarkCreationTimeHoyo.Internal.Types
bookmarkDirectoryHoyo.Internal.Types
bookmarkIndexHoyo.Internal.Types
bookmarkNameHoyo.Internal.Types
Bookmarks 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
bookmarksHoyo.Internal.Types
bookmarksCodecHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
BookmarkSearchTermHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
bookmarkSearchTermHoyo.Internal.Parse
bookmarksFromDefaultHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
bookmarksPathHoyo.Internal.Types
BoolVHoyo.Internal.Types
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - B)
hoyo-0.5.0.0: Bookmark directories for cd

Index - B

backupBeforeClearHoyo.Internal.Utils
backupFileHoyo.Internal.Utils, Hoyo
Bookmark 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
bookmarkCodecHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
bookmarkCompleterHoyo.CLI.Complete
bookmarkCreationTimeHoyo.Internal.Types
bookmarkDirectoryHoyo.Internal.Types
bookmarkIndexHoyo.Internal.Types
bookmarkNameHoyo.Internal.Types
Bookmarks 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
bookmarksHoyo.Internal.Types
bookmarksCodecHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
BookmarkSearchTermHoyo.Internal.Types, Hoyo.Bookmark, Hoyo
bookmarkSearchTermHoyo.Internal.Parse
bookmarksFromDefaultHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
bookmarksPathHoyo.Internal.Types
BoolVHoyo.Internal.Types
\ No newline at end of file diff --git a/docs/doc-index-C.html b/docs/doc-index-C.html index 5191d87..a6ba3ff 100644 --- a/docs/doc-index-C.html +++ b/docs/doc-index-C.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - C)
hoyo-0.4.0.0: Bookmark directories for cd

Index - C

CheckHoyo.Internal.Types, Hoyo.Command, Hoyo
checkBookmarksHoyo.Internal.Types, Hoyo.Command, Hoyo
checkCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
checkConfigHoyo.Internal.Types, Hoyo.Command, Hoyo
CheckOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
ClearHoyo.Internal.Types, Hoyo.Command, Hoyo
clearCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
clearDisabledErrMsgHoyo.Internal.Command
ClearOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
combOverrideHoyo.Internal.Command, Hoyo.Command, Hoyo
CommandHoyo.Internal.Types, Hoyo.Command, Hoyo
commandCodecHoyo.Internal.Config
CommandVHoyo.Internal.Types
Config 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Config, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Config, Hoyo
configHoyo.Internal.Types
configAddDefaultCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigAddDefaultOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
ConfigCmdHoyo.Internal.Types, Hoyo.Command, Hoyo
configCodecHoyo.Internal.Config
ConfigCommandHoyo.Internal.Types, Hoyo.Command, Hoyo
configCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
configKeyCompleterHoyo.CLI.Complete
configPathHoyo.Internal.Types
configPrintCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigPrintOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
configResetCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigResetOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
configSetCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigSetOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
ConfigValueHoyo.Internal.Types
configValueCompleterHoyo.CLI.Complete
ConfigValueTypeHoyo.Internal.Types
ConflictHoyo.Internal.Types, Hoyo.Command, Hoyo
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - C)
hoyo-0.5.0.0: Bookmark directories for cd

Index - C

CheckHoyo.Internal.Types, Hoyo.Command, Hoyo
checkBookmarksHoyo.Internal.Types, Hoyo.Command, Hoyo
checkCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
checkConfigHoyo.Internal.Types, Hoyo.Command, Hoyo
CheckOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
ClearHoyo.Internal.Types, Hoyo.Command, Hoyo
clearCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
clearDisabledErrMsgHoyo.Internal.Command
ClearOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
combOverrideHoyo.Internal.Command, Hoyo.Command, Hoyo
CommandHoyo.Internal.Types, Hoyo.Command, Hoyo
commandCodecHoyo.Internal.Config
CommandVHoyo.Internal.Types
Config 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Config, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Config, Hoyo
configHoyo.Internal.Types
configAddDefaultCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigAddDefaultOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
ConfigCmdHoyo.Internal.Types, Hoyo.Command, Hoyo
configCodecHoyo.Internal.Config
ConfigCommandHoyo.Internal.Types, Hoyo.Command, Hoyo
configCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
configKeyCompleterHoyo.CLI.Complete
configPathHoyo.Internal.Types
configPrintCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigPrintOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
configResetCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigResetOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
configSetCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
ConfigSetOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
ConfigValueHoyo.Internal.Types
configValueCompleterHoyo.CLI.Complete
ConfigValueTypeHoyo.Internal.Types
ConflictHoyo.Internal.Types, Hoyo.Command, Hoyo
\ No newline at end of file diff --git a/docs/doc-index-D.html b/docs/doc-index-D.html index a501556..537110b 100644 --- a/docs/doc-index-D.html +++ b/docs/doc-index-D.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - D)
hoyo-0.4.0.0: Bookmark directories for cd

Index - D

dataPathHoyo.Internal.Types, Hoyo.Command, Hoyo
decodeBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
decodeBookmarksFileHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
decodeConfigHoyo.Internal.Config, Hoyo.Config, Hoyo
decodeConfigFileHoyo.Internal.Config, Hoyo.Config, Hoyo
DefaultBookmark 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
defaultBookmarkCodecHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
defaultBookmarkDirectoryHoyo.Internal.Types
defaultBookmarkNameHoyo.Internal.Types
defaultBookmarksHoyo.Internal.Utils
defaultBookmarksPathHoyo.Internal.Env, Hoyo.Env, Hoyo
DefaultBookmarkVHoyo.Internal.Types
DefaultCommandHoyo.Internal.Types, Hoyo.Command, Hoyo
defaultCommand 
1 (Function)Hoyo.Internal.Utils
2 (Function)Hoyo.Internal.Parse, Hoyo.CLI.Parse
defaultConfigHoyo.Internal.Config, Hoyo.Config, Hoyo
defaultConfigPathHoyo.Internal.Env, Hoyo.Env, Hoyo
defaultGlobalOptionsHoyo.Internal.Command, Hoyo.Command, Hoyo
defaultOverrideOptionsHoyo.Internal.Command, Hoyo.Command, Hoyo
DeleteHoyo.Internal.Types, Hoyo.Command, Hoyo
deleteCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
DeleteOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
deleteSearchHoyo.Internal.Types, Hoyo.Command, Hoyo
displayCreationTimeHoyo.Internal.Utils
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - D)
hoyo-0.5.0.0: Bookmark directories for cd

Index - D

dataPathHoyo.Internal.Types, Hoyo.Command, Hoyo
decodeBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
decodeBookmarksFileHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
decodeConfigHoyo.Internal.Config, Hoyo.Config, Hoyo
decodeConfigFileHoyo.Internal.Config, Hoyo.Config, Hoyo
DefaultBookmark 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Bookmark, Hoyo
defaultBookmarkCodecHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
defaultBookmarkDirectoryHoyo.Internal.Types
defaultBookmarkNameHoyo.Internal.Types
defaultBookmarksHoyo.Internal.Utils
defaultBookmarksPathHoyo.Internal.Env, Hoyo.Env, Hoyo
DefaultBookmarkVHoyo.Internal.Types
DefaultCommandHoyo.Internal.Types, Hoyo.Command, Hoyo
defaultCommand 
1 (Function)Hoyo.Internal.Utils
2 (Function)Hoyo.Internal.Parse, Hoyo.CLI.Parse
defaultConfigHoyo.Internal.Config, Hoyo.Config, Hoyo
defaultConfigPathHoyo.Internal.Env, Hoyo.Env, Hoyo
defaultGlobalOptionsHoyo.Internal.Command, Hoyo.Command, Hoyo
defaultOverrideOptionsHoyo.Internal.Command, Hoyo.Command, Hoyo
DeleteHoyo.Internal.Types, Hoyo.Command, Hoyo
deleteCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
DeleteOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
deleteSearchHoyo.Internal.Types, Hoyo.Command, Hoyo
displayCreationTimeHoyo.Internal.Utils
\ No newline at end of file diff --git a/docs/doc-index-E.html b/docs/doc-index-E.html index 9558608..2211d7a 100644 --- a/docs/doc-index-E.html +++ b/docs/doc-index-E.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - E)
hoyo-0.4.0.0: Bookmark directories for cd

Index - E

enableClearingHoyo.Internal.Utils
enableResetHoyo.Internal.Utils
encodeBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
encodeBookmarksFileHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
encodeConfigHoyo.Internal.Config, Hoyo.Config, Hoyo
encodeConfigFileHoyo.Internal.Config, Hoyo.Config, Hoyo
Env 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Env, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Env, Hoyo
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - E)
hoyo-0.5.0.0: Bookmark directories for cd

Index - E

enableClearingHoyo.Internal.Utils
enableResetHoyo.Internal.Utils
encodeBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
encodeBookmarksFileHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
encodeConfigHoyo.Internal.Config, Hoyo.Config, Hoyo
encodeConfigFileHoyo.Internal.Config, Hoyo.Config, Hoyo
Env 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Env, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Env, Hoyo
\ No newline at end of file diff --git a/docs/doc-index-F.html b/docs/doc-index-F.html index ed7c3a9..d883fc6 100644 --- a/docs/doc-index-F.html +++ b/docs/doc-index-F.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - F)
hoyo-0.4.0.0: Bookmark directories for cd

Index - F

failOnErrorHoyo.Internal.Utils
filterBookmarkByDirInfixHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
filterBookmarkByNameHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
filterBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
formatArgsHoyo.Internal.Utils
formatBookmarkHoyo.Internal.Utils, Hoyo.Bookmark, Hoyo
formatBookmarksHoyo.Internal.Utils, Hoyo.Bookmark, Hoyo
formatBookmarkSearchTermHoyo.Internal.Utils
formatCommandHoyo.Internal.Utils
formatConfigCommandHoyo.Internal.Utils
formatConfigValueHoyo.Internal.Utils
formatDefaultBookmarkHoyo.Internal.Utils
formatGlobalsHoyo.Internal.Utils
formatOptionsHoyo.Internal.Utils
formatOverrideHoyo.Internal.Utils
formatOverridesHoyo.Internal.Utils
formatSearchTermHoyo.Internal.Utils
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - F)
hoyo-0.5.0.0: Bookmark directories for cd

Index - F

failOnErrorHoyo.Internal.Utils
filterBookmarkByDirInfixHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
filterBookmarkByNameHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
filterBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
formatArgsHoyo.Internal.Utils
formatBookmarkHoyo.Internal.Utils, Hoyo.Bookmark, Hoyo
formatBookmarksHoyo.Internal.Utils, Hoyo.Bookmark, Hoyo
formatBookmarkSearchTermHoyo.Internal.Utils
formatCommandHoyo.Internal.Utils
formatConfigCommandHoyo.Internal.Utils
formatConfigValueHoyo.Internal.Utils
formatDefaultBookmarkHoyo.Internal.Utils
formatGlobalsHoyo.Internal.Utils
formatOptionsHoyo.Internal.Utils
formatOverrideHoyo.Internal.Utils
formatOverridesHoyo.Internal.Utils
formatSearchTermHoyo.Internal.Utils
\ No newline at end of file diff --git a/docs/doc-index-G.html b/docs/doc-index-G.html index 44c0022..499dcc3 100644 --- a/docs/doc-index-G.html +++ b/docs/doc-index-G.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - G)
hoyo-0.4.0.0: Bookmark directories for cd

Index - G

getBackupFileHoyo.Internal.Utils
getBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
getBoolHoyo.Internal.Utils
getCommandHoyo.Internal.Utils
getDefaultBookmarkHoyo.Internal.Utils
getEnvHoyo.Internal.Env, Hoyo.Env, Hoyo
getEnvAndRunCommandHoyo
getEnvAndRunHoyoHoyo
getKeyValsHoyo.Internal.Config, Hoyo.Config, Hoyo
getListHoyo.Internal.Utils
getMaybeHoyo.Internal.Utils
globalConfigPathHoyo.Internal.Types, Hoyo.Command, Hoyo
GlobalOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
globalOptionsHoyo.Internal.Parse, Hoyo.CLI.Parse
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - G)
hoyo-0.5.0.0: Bookmark directories for cd

Index - G

getBackupFileHoyo.Internal.Utils
getBookmarksHoyo.Internal.Bookmark, Hoyo.Bookmark, Hoyo
getBoolHoyo.Internal.Utils
getCommandHoyo.Internal.Utils
getDefaultBookmarkHoyo.Internal.Utils
getEnvHoyo.Internal.Env, Hoyo.Env, Hoyo
getEnvAndRunCommandHoyo
getEnvAndRunHoyoHoyo
getKeyValsHoyo.Internal.Config, Hoyo.Config, Hoyo
getListHoyo.Internal.Utils
getMaybeHoyo.Internal.Utils
globalConfigPathHoyo.Internal.Types, Hoyo.Command, Hoyo
GlobalOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
globalOptionsHoyo.Internal.Parse, Hoyo.CLI.Parse
\ No newline at end of file diff --git a/docs/doc-index-H.html b/docs/doc-index-H.html index 187cbea..a6fc272 100644 --- a/docs/doc-index-H.html +++ b/docs/doc-index-H.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - H)
hoyo-0.4.0.0: Bookmark directories for cd

Index - H

HelpHoyo.Internal.Types, Hoyo.Command, Hoyo
helpCommandHoyo.Internal.Parse
HelpOptions 
1 (Type/Class)Hoyo.Internal.Types
2 (Data Constructor)Hoyo.Internal.Types
helpSubcommandHoyo.Internal.Types
hoyoFooterHoyo.Internal.Parse
HoyoMonad 
1 (Type/Class)Hoyo.Internal.Types, Hoyo
2 (Data Constructor)Hoyo.Internal.Types
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - H)
hoyo-0.5.0.0: Bookmark directories for cd

Index - H

HelpHoyo.Internal.Types, Hoyo.Command, Hoyo
helpCommandHoyo.Internal.Parse
HelpOptions 
1 (Type/Class)Hoyo.Internal.Types
2 (Data Constructor)Hoyo.Internal.Types
helpSubcommandHoyo.Internal.Types
hoyoFooterHoyo.Internal.Parse
HoyoMonad 
1 (Type/Class)Hoyo.Internal.Types, Hoyo
2 (Data Constructor)Hoyo.Internal.Types
\ No newline at end of file diff --git a/docs/doc-index-I.html b/docs/doc-index-I.html index f5a608b..117325f 100644 --- a/docs/doc-index-I.html +++ b/docs/doc-index-I.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - I)
hoyo-0.4.0.0: Bookmark directories for cd

Index - I

initBookmarksIfNotExistsHoyo.Internal.Env
initConfigIfNotExistsHoyo.Internal.Env
initEnvHoyo.Internal.Env, Hoyo.Env, Hoyo
initEnvIfNotExistsHoyo.Internal.Env
initPathHoyo.Internal.Env
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - I)
hoyo-0.5.0.0: Bookmark directories for cd

Index - I

initBookmarksIfNotExistsHoyo.Internal.Env
initConfigIfNotExistsHoyo.Internal.Env
initEnvHoyo.Internal.Env, Hoyo.Env, Hoyo
initEnvIfNotExistsHoyo.Internal.Env
initPathHoyo.Internal.Env
\ No newline at end of file diff --git a/docs/doc-index-L.html b/docs/doc-index-L.html index 29b650d..cf9c614 100644 --- a/docs/doc-index-L.html +++ b/docs/doc-index-L.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - L)
hoyo-0.4.0.0: Bookmark directories for cd

Index - L

ListHoyo.Internal.Types, Hoyo.Command, Hoyo
listCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
listFilterDirectoryInfixHoyo.Internal.Types, Hoyo.Command, Hoyo
listFilterNameHoyo.Internal.Types, Hoyo.Command, Hoyo
ListOfVHoyo.Internal.Types
ListOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - L)
hoyo-0.5.0.0: Bookmark directories for cd

Index - L

ListHoyo.Internal.Types, Hoyo.Command, Hoyo
listCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
listFilterDirectoryInfixHoyo.Internal.Types, Hoyo.Command, Hoyo
listFilterNameHoyo.Internal.Types, Hoyo.Command, Hoyo
ListOfVHoyo.Internal.Types
ListOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
\ No newline at end of file diff --git a/docs/doc-index-M.html b/docs/doc-index-M.html index 00c7881..93197cc 100644 --- a/docs/doc-index-M.html +++ b/docs/doc-index-M.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - M)
hoyo-0.4.0.0: Bookmark directories for cd
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - M)
hoyo-0.5.0.0: Bookmark directories for cd
\ No newline at end of file diff --git a/docs/doc-index-N.html b/docs/doc-index-N.html index e15b01e..d2015d5 100644 --- a/docs/doc-index-N.html +++ b/docs/doc-index-N.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - N)
hoyo-0.4.0.0: Bookmark directories for cd
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - N)
hoyo-0.5.0.0: Bookmark directories for cd
\ No newline at end of file diff --git a/docs/doc-index-O.html b/docs/doc-index-O.html index 92a8a84..eb682ac 100644 --- a/docs/doc-index-O.html +++ b/docs/doc-index-O.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - O)
hoyo-0.4.0.0: Bookmark directories for cd

Index - O

optCommandHoyo.Internal.Types, Hoyo.Command, Hoyo
optGlobalsHoyo.Internal.Types, Hoyo.Command, Hoyo
Options 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
optionsHoyo.Internal.Parse, Hoyo.CLI.Parse
overrideBackupBeforeClearHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideConfigHoyo.Internal.Command, Hoyo.Command, Hoyo
overrideDisplayCreationTimeHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideEnableClearingHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideEnableResetHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideEnvHoyo.Internal.Command, Hoyo.Command, Hoyo
overrideFailOnErrorHoyo.Internal.Types, Hoyo.Command, Hoyo
OverrideFalseHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideFuncHoyo.Internal.Command
OverrideOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
overrideOptionsHoyo.Internal.Parse, Hoyo.CLI.Parse
overridesHoyo.Internal.Types, Hoyo.Command, Hoyo
OverrideTrueHoyo.Internal.Types, Hoyo.Command, Hoyo
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - O)
hoyo-0.5.0.0: Bookmark directories for cd

Index - O

optCommandHoyo.Internal.Types, Hoyo.Command, Hoyo
optGlobalsHoyo.Internal.Types, Hoyo.Command, Hoyo
Options 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
optionsHoyo.Internal.Parse, Hoyo.CLI.Parse
overrideBackupBeforeClearHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideConfigHoyo.Internal.Command, Hoyo.Command, Hoyo
overrideDisplayCreationTimeHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideEnableClearingHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideEnableResetHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideEnvHoyo.Internal.Command, Hoyo.Command, Hoyo
overrideFailOnErrorHoyo.Internal.Types, Hoyo.Command, Hoyo
OverrideFalseHoyo.Internal.Types, Hoyo.Command, Hoyo
overrideFuncHoyo.Internal.Command
OverrideOptions 
1 (Type/Class)Hoyo.Internal.Types, Hoyo.Command, Hoyo
2 (Data Constructor)Hoyo.Internal.Types, Hoyo.Command, Hoyo
overrideOptionsHoyo.Internal.Parse, Hoyo.CLI.Parse
overridesHoyo.Internal.Types, Hoyo.Command, Hoyo
OverrideTrueHoyo.Internal.Types, Hoyo.Command, Hoyo
\ No newline at end of file diff --git a/docs/doc-index-P.html b/docs/doc-index-P.html index 1dcb2e5..8cb516d 100644 --- a/docs/doc-index-P.html +++ b/docs/doc-index-P.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - P)
hoyo-0.4.0.0: Bookmark directories for cd

Index - P

parseCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
parseOptionsHoyo.Internal.Parse, Hoyo.CLI.Parse
parseOverrideHoyo.Internal.Parse
parseOverrideBackupBeforeClearHoyo.Internal.Parse
parseOverrideDisplayCreationTimeHoyo.Internal.Parse
parseOverrideEnableClearingHoyo.Internal.Parse
parseOverrideEnableResetHoyo.Internal.Parse
parseOverrideFailOnErrorHoyo.Internal.Parse
PrintHoyo.Internal.Types, Hoyo.Command, Hoyo
printStderrHoyo.Internal.Utils, Hoyo
printStdoutHoyo.Internal.Utils, Hoyo
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - P)
hoyo-0.5.0.0: Bookmark directories for cd

Index - P

parseCommandHoyo.Internal.Parse, Hoyo.CLI.Parse
parseOptionsHoyo.Internal.Parse, Hoyo.CLI.Parse
parseOverrideHoyo.Internal.Parse
parseOverrideBackupBeforeClearHoyo.Internal.Parse
parseOverrideDisplayCreationTimeHoyo.Internal.Parse
parseOverrideEnableClearingHoyo.Internal.Parse
parseOverrideEnableResetHoyo.Internal.Parse
parseOverrideFailOnErrorHoyo.Internal.Parse
PrintHoyo.Internal.Types, Hoyo.Command, Hoyo
printStderrHoyo.Internal.Utils, Hoyo
printStdoutHoyo.Internal.Utils, Hoyo
\ No newline at end of file diff --git a/docs/doc-index-R.html b/docs/doc-index-R.html index 321e965..e68423c 100644 --- a/docs/doc-index-R.html +++ b/docs/doc-index-R.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - R)
hoyo-0.4.0.0: Bookmark directories for cd
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - R)
hoyo-0.5.0.0: Bookmark directories for cd
\ No newline at end of file diff --git a/docs/doc-index-S.html b/docs/doc-index-S.html index 5473c26..0a889d7 100644 --- a/docs/doc-index-S.html +++ b/docs/doc-index-S.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - S)
hoyo-0.4.0.0: Bookmark directories for cd
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - S)
hoyo-0.5.0.0: Bookmark directories for cd
\ No newline at end of file diff --git a/docs/doc-index-T.html b/docs/doc-index-T.html index d9f6c83..0688ae1 100644 --- a/docs/doc-index-T.html +++ b/docs/doc-index-T.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - T)
hoyo-0.4.0.0: Bookmark directories for cd
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - T)
hoyo-0.5.0.0: Bookmark directories for cd
\ No newline at end of file diff --git a/docs/doc-index-U.html b/docs/doc-index-U.html index 803f778..c30f464 100644 --- a/docs/doc-index-U.html +++ b/docs/doc-index-U.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - U)
hoyo-0.4.0.0: Bookmark directories for cd
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - U)
hoyo-0.5.0.0: Bookmark directories for cd
\ No newline at end of file diff --git a/docs/doc-index-V.html b/docs/doc-index-V.html index 3ed011e..6d71ffd 100644 --- a/docs/doc-index-V.html +++ b/docs/doc-index-V.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - V)
hoyo-0.4.0.0: Bookmark directories for cd
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - V)
hoyo-0.5.0.0: Bookmark directories for cd
\ No newline at end of file diff --git a/docs/doc-index-W.html b/docs/doc-index-W.html index e642671..3e028b9 100644 --- a/docs/doc-index-W.html +++ b/docs/doc-index-W.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index - W)
hoyo-0.4.0.0: Bookmark directories for cd
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index - W)
hoyo-0.5.0.0: Bookmark directories for cd
\ No newline at end of file diff --git a/docs/doc-index.html b/docs/doc-index.html index c2b3330..ce8d074 100644 --- a/docs/doc-index.html +++ b/docs/doc-index.html @@ -1 +1 @@ -hoyo-0.4.0.0: Bookmark directories for cd (Index)
hoyo-0.4.0.0: Bookmark directories for cd
\ No newline at end of file +hoyo-0.5.0.0: Bookmark directories for cd (Index)
hoyo-0.5.0.0: Bookmark directories for cd
\ No newline at end of file diff --git a/docs/hoyo.haddock b/docs/hoyo.haddock index 1e3673f..800f204 100644 Binary files a/docs/hoyo.haddock and b/docs/hoyo.haddock differ diff --git a/docs/index.html b/docs/index.html index 3939df0..f16ceaa 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,3 +1,3 @@ -hoyo-0.4.0.0: Bookmark directories for cd
hoyo-0.4.0.0: Bookmark directories for cd

hoyo-0.4.0.0: Bookmark directories for cd

hoyo is a command-line utility enabling easy bookmarking +hoyo-0.5.0.0: Bookmark directories for cd

hoyo-0.5.0.0: Bookmark directories for cd

hoyo-0.5.0.0: Bookmark directories for cd

hoyo is a command-line utility enabling easy bookmarking of directory for quick cd-like behaviour.

See the github readme for more information.

\ No newline at end of file diff --git a/docs/src/HoYo.Bookmark.html b/docs/src/HoYo.Bookmark.html deleted file mode 100644 index 9bc1584..0000000 --- a/docs/src/HoYo.Bookmark.html +++ /dev/null @@ -1,42 +0,0 @@ -
{-|
-Module      : HoYo.Bookmark
-Copyright   : (c) Frederick Pringle, 2023
-License     : BSD-3-Clause
-Maintainer  : freddyjepringle@gmail.com
-
-The 'Bookmark' type provides a representation of bookmarks saved and used
-by the hoyo program. This module exports some utility datatypes and functions
-used for working with bookmarks.
--}
-
-module HoYo.Bookmark (
-  -- * The Bookmark type
-  Bookmark (..)
-  , Bookmarks (..)
-  , BookmarkSearchTerm (..)
-  , formatBookmark
-  , formatBookmarks
-  , DefaultBookmark (..)
-
-  -- *  Working with bookmarks
-  , getBookmarks
-  , searchBookmarks
-  , filterBookmarks
-  , filterBookmarkByName
-  , filterBookmarkByDirInfix
-  , bookmarksFromDefault
-
-  -- ** Parsing\/encoding bookmarks from\/to TOML
-  , bookmarkCodec
-  , bookmarksCodec
-  , defaultBookmarkCodec
-  , decodeBookmarks
-  , decodeBookmarksFile
-  , encodeBookmarks
-  , encodeBookmarksFile
-  ) where
-
-import HoYo.Internal.Bookmark
-import HoYo.Internal.Types
-import HoYo.Internal.Utils
-
\ No newline at end of file diff --git a/docs/src/HoYo.CLI.Complete.html b/docs/src/HoYo.CLI.Complete.html deleted file mode 100644 index 1c72a6c..0000000 --- a/docs/src/HoYo.CLI.Complete.html +++ /dev/null @@ -1,129 +0,0 @@ -
{-|
-Module      : HoYo.CLI.Complete
-Copyright   : (c) Frederick Pringle, 2023
-License     : BSD-3-Clause
-Maintainer  : freddyjepringle@gmail.com
-
-Bash competion functions used by the CLI.
--}
-
-module HoYo.CLI.Complete where
-
-import           Control.Monad.IO.Class
-
-import           Data.Maybe
-import qualified Data.Text              as T
-
-import           HoYo
-
-import           Options.Applicative
-
--- | Fetch existing data file and use it to complete bookmark names.
-bookmarkCompleter :: Completer
-bookmarkCompleter :: Completer
-bookmarkCompleter = IO [String] -> Completer
-listIOCompleter (IO [String] -> Completer) -> IO [String] -> Completer
-forall a b. (a -> b) -> a -> b
-$ do
-  String
-sFp <- IO String
-defaultConfigPath
-  String
-bFp <- IO String
-defaultBookmarksPath
-  Either Text Bookmarks
-res <- GlobalOptions
--> String
--> String
--> HoYoMonad Bookmarks
--> IO (Either Text Bookmarks)
-forall a.
-GlobalOptions
--> String -> String -> HoYoMonad a -> IO (Either Text a)
-withFiles GlobalOptions
-defaultGlobalOptions String
-bFp String
-sFp HoYoMonad Bookmarks
-getBookmarks
-  case Either Text Bookmarks
-res of
-    Left Text
-err              -> do IO () -> IO ()
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO () -> IO ()) -> IO () -> IO ()
-forall a b. (a -> b) -> a -> b
-$ Text -> IO ()
-forall a. Show a => a -> IO ()
-print Text
-err
-                                [String] -> IO [String]
-forall (m :: * -> *) a. Monad m => a -> m a
-return []
-    Right (Bookmarks [Bookmark]
-bms) -> do
-      let indices :: [String]
-indices = (Bookmark -> String) -> [Bookmark] -> [String]
-forall a b. (a -> b) -> [a] -> [b]
-map (Int -> String
-forall a. Show a => a -> String
-show (Int -> String) -> (Bookmark -> Int) -> Bookmark -> String
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Bookmark -> Int
-_bookmarkIndex) [Bookmark]
-bms
-      let nicknames :: [String]
-nicknames = (Bookmark -> Maybe String) -> [Bookmark] -> [String]
-forall a b. (a -> Maybe b) -> [a] -> [b]
-mapMaybe ((Text -> String) -> Maybe Text -> Maybe String
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-fmap Text -> String
-T.unpack (Maybe Text -> Maybe String)
--> (Bookmark -> Maybe Text) -> Bookmark -> Maybe String
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Bookmark -> Maybe Text
-_bookmarkName) [Bookmark]
-bms
-      [String] -> IO [String]
-forall (m :: * -> *) a. Monad m => a -> m a
-return ([String]
-nicknames [String] -> [String] -> [String]
-forall a. Semigroup a => a -> a -> a
-<> [String]
-indices)
-
--- | Complete configuration keys.
-configKeyCompleter :: Completer
-configKeyCompleter :: Completer
-configKeyCompleter = [String] -> Completer
-listCompleter [
-  String
-"fail_on_error"
-  , String
-"display_creation_time"
-  , String
-"enable_clearing"
-  , String
-"enable_reset"
-  , String
-"backup_before_clear"
-  , String
-"default_command"
-  ]
-
--- | Complete configuration values.
---
--- TODO: could be more sophisticated, considering the current key
-configValueCompleter :: Completer
-configValueCompleter :: Completer
-configValueCompleter = [String] -> Completer
-listCompleter [
-  String
-"true"
-  , String
-"True"
-  , String
-"false"
-  , String
-"False"
-  ]
-
\ No newline at end of file diff --git a/docs/src/HoYo.CLI.Parse.html b/docs/src/HoYo.CLI.Parse.html deleted file mode 100644 index f5812a1..0000000 --- a/docs/src/HoYo.CLI.Parse.html +++ /dev/null @@ -1,39 +0,0 @@ -
{-|
-Module      : HoYo.CLI.Parse
-Copyright   : (c) Frederick Pringle, 2023
-License     : BSD-3-Clause
-Maintainer  : freddyjepringle@gmail.com
-
-Parse CLI arguments.
--}
-
-module HoYo.CLI.Parse (
-  -- * Parsing CLI arguments and options
-    options
-  , parseOptions
-  , parseCommand
-  , globalOptions
-  , overrideOptions
-
-  -- * Parsing specific CLI commands
-  , addCommand
-  , moveCommand
-  , listCommand
-  , clearCommand
-  , deleteCommand
-  , checkCommand
-  , defaultCommand
-
-  -- ** Parsing sub-commands for hoyo config
-  , configCommand
-  , configPrintCommand
-  , configResetCommand
-  , configSetCommand
-  , configAddDefaultCommand
-
-  -- * Misc/Utility
-  , splitArgs
-  ) where
-
-import HoYo.Internal.Parse
-
\ No newline at end of file diff --git a/docs/src/HoYo.Command.html b/docs/src/HoYo.Command.html deleted file mode 100644 index 6758580..0000000 --- a/docs/src/HoYo.Command.html +++ /dev/null @@ -1,56 +0,0 @@ -
{-|
-Module      : HoYo.Command
-Copyright   : (c) Frederick Pringle, 2023
-License     : BSD-3-Clause
-Maintainer  : freddyjepringle@gmail.com
-
-This module defines data-types and runner functions for the hoyo
-command-line program.
--}
-
-module HoYo.Command (
-  -- * Running CLI commands
-  runCommand
-  , modifyBookmarks
-  , modifyBookmarksM
-
-  -- ** Specific command runners
-  , runAdd
-  , runMove
-  , runList
-  , runClear
-  , runDelete
-  , runRefresh
-  , runConfig
-  , runCheck
-  , runDefaultCommand
-
-  -- * Types
-  , Options (..)
-  , Command (..)
-  , AddOptions (..)
-  , MoveOptions (..)
-  , ListOptions (..)
-  , ClearOptions (..)
-  , DeleteOptions (..)
-  , RefreshOptions (..)
-  , ConfigPrintOptions (..)
-  , ConfigResetOptions (..)
-  , ConfigSetOptions (..)
-  , ConfigAddDefaultOptions (..)
-  , ConfigCommand (..)
-  , CheckOptions (..)
-  , GlobalOptions (..)
-  , defaultGlobalOptions
-  , OverrideOptions (..)
-  , defaultOverrideOptions
-  , overrideConfig
-  , overrideEnv
-  , verifyOverrides
-  , combOverride
-  , MaybeOverride (..)
-  ) where
-
-import HoYo.Internal.Command
-import HoYo.Internal.Types
-
\ No newline at end of file diff --git a/docs/src/HoYo.Config.html b/docs/src/HoYo.Config.html deleted file mode 100644 index 5f3fe61..0000000 --- a/docs/src/HoYo.Config.html +++ /dev/null @@ -1,28 +0,0 @@ -
{-|
-Module      : HoYo.Config
-Copyright   : (c) Frederick Pringle, 2023
-License     : BSD-3-Clause
-Maintainer  : freddyjepringle@gmail.com
-
-Configuration for the hoyo program. This is stored on-disk as a TOML file,
-usually at ~/.config/hoyo/config.toml
--}
-
-{-# LANGUAGE RankNTypes #-}
-
-module HoYo.Config (
-  Config (..)
-
-  , defaultConfig
-  , decodeConfig
-  , decodeConfigFile
-  , encodeConfig
-  , encodeConfigFile
-
-  , setConfig
-  , getKeyVals
-  ) where
-
-import HoYo.Internal.Config
-import HoYo.Internal.Types
-
\ No newline at end of file diff --git a/docs/src/HoYo.Env.html b/docs/src/HoYo.Env.html deleted file mode 100644 index 4197258..0000000 --- a/docs/src/HoYo.Env.html +++ /dev/null @@ -1,25 +0,0 @@ -
{-|
-Module      : HoYo.Env
-Copyright   : (c) Frederick Pringle, 2023
-License     : BSD-3-Clause
-Maintainer  : freddyjepringle@gmail.com
-
-The read-only hoyo environment.
--}
-
-module HoYo.Env (
-  -- * HoYo config
-  Env (..)
-  , initEnv
-  , getEnv
-  , writeEnv
-  , readEnv
-
-  -- ** Default file paths
-  , defaultBookmarksPath
-  , defaultConfigPath
-  ) where
-
-import HoYo.Internal.Env
-import HoYo.Internal.Types
-
\ No newline at end of file diff --git a/docs/src/HoYo.Internal.Bookmark.html b/docs/src/HoYo.Internal.Bookmark.html deleted file mode 100644 index 95a3098..0000000 --- a/docs/src/HoYo.Internal.Bookmark.html +++ /dev/null @@ -1,374 +0,0 @@ -
{-|
-Module      : HoYo.Internal.Bookmark
-Copyright   : (c) Frederick Pringle, 2023
-License     : BSD-3-Clause
-Maintainer  : freddyjepringle@gmail.com
-
-Internals used by the HoYo.Bookmark module.
--}
-
-module HoYo.Internal.Bookmark where
-
-import           Control.Monad          (forM, void)
-import           Control.Monad.IO.Class
-
-import           Data.Bifunctor         (first)
-import           Data.Function
-import           Data.List
-import qualified Data.Text              as T
-import           Data.Time
-
-import           HoYo.Internal.Types
-import           HoYo.Internal.Utils
-
-import           Lens.Micro.Extras
-
-import qualified Toml
-import           Toml                   (TomlCodec, (.=))
-
--- | A 'TomlCodec' for encoding and decoding 'Bookmark's.
-bookmarkCodec :: TomlCodec Bookmark
-bookmarkCodec :: TomlCodec Bookmark
-bookmarkCodec = FilePath -> Int -> ZonedTime -> Maybe Text -> Bookmark
-Bookmark
-  (FilePath -> Int -> ZonedTime -> Maybe Text -> Bookmark)
--> Codec Bookmark FilePath
--> Codec Bookmark (Int -> ZonedTime -> Maybe Text -> Bookmark)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Key -> TomlCodec FilePath
-Toml.string     Key
-"directory"           TomlCodec FilePath
--> (Bookmark -> FilePath) -> Codec Bookmark FilePath
-forall field a object.
-Codec field a -> (object -> field) -> Codec object a
-.= Bookmark -> FilePath
-_bookmarkDirectory
-  Codec Bookmark (Int -> ZonedTime -> Maybe Text -> Bookmark)
--> Codec Bookmark Int
--> Codec Bookmark (ZonedTime -> Maybe Text -> Bookmark)
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Key -> TomlCodec Int
-Toml.int        Key
-"index"               TomlCodec Int -> (Bookmark -> Int) -> Codec Bookmark Int
-forall field a object.
-Codec field a -> (object -> field) -> Codec object a
-.= Bookmark -> Int
-_bookmarkIndex
-  Codec Bookmark (ZonedTime -> Maybe Text -> Bookmark)
--> Codec Bookmark ZonedTime
--> Codec Bookmark (Maybe Text -> Bookmark)
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Key -> TomlCodec ZonedTime
-Toml.zonedTime  Key
-"created"             TomlCodec ZonedTime
--> (Bookmark -> ZonedTime) -> Codec Bookmark ZonedTime
-forall field a object.
-Codec field a -> (object -> field) -> Codec object a
-.= Bookmark -> ZonedTime
-_bookmarkCreationTime
-  Codec Bookmark (Maybe Text -> Bookmark)
--> Codec Bookmark (Maybe Text) -> TomlCodec Bookmark
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> TomlCodec Text -> TomlCodec (Maybe Text)
-forall a. TomlCodec a -> TomlCodec (Maybe a)
-Toml.dioptional (Key -> TomlCodec Text
-Toml.text   Key
-"name")  TomlCodec (Maybe Text)
--> (Bookmark -> Maybe Text) -> Codec Bookmark (Maybe Text)
-forall field a object.
-Codec field a -> (object -> field) -> Codec object a
-.= Bookmark -> Maybe Text
-_bookmarkName
-
--- | A 'TomlCodec' for encoding and decoding 'Bookmark's.
-defaultBookmarkCodec :: TomlCodec DefaultBookmark
-defaultBookmarkCodec :: TomlCodec DefaultBookmark
-defaultBookmarkCodec = FilePath -> Maybe Text -> DefaultBookmark
-DefaultBookmark
-  (FilePath -> Maybe Text -> DefaultBookmark)
--> Codec DefaultBookmark FilePath
--> Codec DefaultBookmark (Maybe Text -> DefaultBookmark)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Key -> TomlCodec FilePath
-Toml.string     Key
-"directory"           TomlCodec FilePath
--> (DefaultBookmark -> FilePath) -> Codec DefaultBookmark FilePath
-forall field a object.
-Codec field a -> (object -> field) -> Codec object a
-.= DefaultBookmark -> FilePath
-_defaultBookmarkDirectory
-  Codec DefaultBookmark (Maybe Text -> DefaultBookmark)
--> Codec DefaultBookmark (Maybe Text) -> TomlCodec DefaultBookmark
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> TomlCodec Text -> TomlCodec (Maybe Text)
-forall a. TomlCodec a -> TomlCodec (Maybe a)
-Toml.dioptional (Key -> TomlCodec Text
-Toml.text   Key
-"name")  TomlCodec (Maybe Text)
--> (DefaultBookmark -> Maybe Text)
--> Codec DefaultBookmark (Maybe Text)
-forall field a object.
-Codec field a -> (object -> field) -> Codec object a
-.= DefaultBookmark -> Maybe Text
-_defaultBookmarkName
-
--- | A 'TomlCodec' for encoding and decoding 'Bookmarks'.
-bookmarksCodec :: TomlCodec Bookmarks
-bookmarksCodec :: TomlCodec Bookmarks
-bookmarksCodec = TomlCodec [Bookmark] -> TomlCodec Bookmarks
-forall b a. Coercible a b => TomlCodec a -> TomlCodec b
-Toml.diwrap (TomlCodec Bookmark -> Key -> TomlCodec [Bookmark]
-forall a. TomlCodec a -> Key -> TomlCodec [a]
-Toml.list TomlCodec Bookmark
-bookmarkCodec Key
-"bookmark")
-
--- | Decode a 'Bookmark' from a Text.
-decodeBookmarks :: T.Text -> Either T.Text Bookmarks
-decodeBookmarks :: Text -> Either Text Bookmarks
-decodeBookmarks = ([TomlDecodeError] -> Text)
--> Either [TomlDecodeError] Bookmarks -> Either Text Bookmarks
-forall (p :: * -> * -> *) a b c.
-Bifunctor p =>
-(a -> b) -> p a c -> p b c
-first [TomlDecodeError] -> Text
-Toml.prettyTomlDecodeErrors (Either [TomlDecodeError] Bookmarks -> Either Text Bookmarks)
--> (Text -> Either [TomlDecodeError] Bookmarks)
--> Text
--> Either Text Bookmarks
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. TomlCodec Bookmarks -> Text -> Either [TomlDecodeError] Bookmarks
-forall a. TomlCodec a -> Text -> Either [TomlDecodeError] a
-Toml.decodeExact TomlCodec Bookmarks
-bookmarksCodec
-
--- | Decode a 'Bookmark' from a file.
-decodeBookmarksFile :: MonadIO m => FilePath -> m (Either T.Text Bookmarks)
-decodeBookmarksFile :: FilePath -> m (Either Text Bookmarks)
-decodeBookmarksFile = (Either [TomlDecodeError] Bookmarks -> Either Text Bookmarks)
--> m (Either [TomlDecodeError] Bookmarks)
--> m (Either Text Bookmarks)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-fmap (([TomlDecodeError] -> Text)
--> Either [TomlDecodeError] Bookmarks -> Either Text Bookmarks
-forall (p :: * -> * -> *) a b c.
-Bifunctor p =>
-(a -> b) -> p a c -> p b c
-first [TomlDecodeError] -> Text
-Toml.prettyTomlDecodeErrors) (m (Either [TomlDecodeError] Bookmarks)
- -> m (Either Text Bookmarks))
--> (FilePath -> m (Either [TomlDecodeError] Bookmarks))
--> FilePath
--> m (Either Text Bookmarks)
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. TomlCodec Bookmarks
--> FilePath -> m (Either [TomlDecodeError] Bookmarks)
-forall a (m :: * -> *).
-MonadIO m =>
-TomlCodec a -> FilePath -> m (Either [TomlDecodeError] a)
-Toml.decodeFileExact TomlCodec Bookmarks
-bookmarksCodec
-
--- | Encode a 'Bookmark' to a Text.
-encodeBookmarks :: Bookmarks -> T.Text
-encodeBookmarks :: Bookmarks -> Text
-encodeBookmarks = TomlCodec Bookmarks -> Bookmarks -> Text
-forall a. TomlCodec a -> a -> Text
-Toml.encode TomlCodec Bookmarks
-bookmarksCodec
-
--- | Encode a 'Bookmark' to a file.
-encodeBookmarksFile :: MonadIO m => FilePath -> Bookmarks -> m ()
-encodeBookmarksFile :: FilePath -> Bookmarks -> m ()
-encodeBookmarksFile FilePath
-fp = m Text -> m ()
-forall (f :: * -> *) a. Functor f => f a -> f ()
-void (m Text -> m ()) -> (Bookmarks -> m Text) -> Bookmarks -> m ()
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. TomlCodec Bookmarks -> FilePath -> Bookmarks -> m Text
-forall a (m :: * -> *).
-MonadIO m =>
-TomlCodec a -> FilePath -> a -> m Text
-Toml.encodeToFile TomlCodec Bookmarks
-bookmarksCodec FilePath
-fp
-
--- | @searchBookmarks searchTerm bookmarks@ partitions @bookmarks@ into a list of
--- 'Bookmark's that match the search term and a list of those that do not.
-searchBookmarks :: BookmarkSearchTerm -> Bookmarks -> ([Bookmark], [Bookmark])
-searchBookmarks :: BookmarkSearchTerm -> Bookmarks -> ([Bookmark], [Bookmark])
-searchBookmarks (SearchIndex Int
-idx) (Bookmarks [Bookmark]
-bms) =
-  (Bookmark -> Bool) -> [Bookmark] -> ([Bookmark], [Bookmark])
-forall a. (a -> Bool) -> [a] -> ([a], [a])
-partition ((Int -> Int -> Bool
-forall a. Eq a => a -> a -> Bool
-== Int
-idx) (Int -> Bool) -> (Bookmark -> Int) -> Bookmark -> Bool
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Getting Int Bookmark Int -> Bookmark -> Int
-forall a s. Getting a s a -> s -> a
-view Getting Int Bookmark Int
-Lens' Bookmark Int
-bookmarkIndex) [Bookmark]
-bms
-searchBookmarks (SearchName Text
-name) (Bookmarks [Bookmark]
-bms) =
-  (Bookmark -> Bool) -> [Bookmark] -> ([Bookmark], [Bookmark])
-forall a. (a -> Bool) -> [a] -> ([a], [a])
-partition ((Maybe Text -> Maybe Text -> Bool)
--> (Maybe Text -> Maybe Text) -> Maybe Text -> Maybe Text -> Bool
-forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
-on Maybe Text -> Maybe Text -> Bool
-forall a. Eq a => a -> a -> Bool
-(==) ((Text -> Text) -> Maybe Text -> Maybe Text
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-fmap Text -> Text
-T.toLower) (Text -> Maybe Text
-forall a. a -> Maybe a
-Just Text
-name) (Maybe Text -> Bool)
--> (Bookmark -> Maybe Text) -> Bookmark -> Bool
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Getting (Maybe Text) Bookmark (Maybe Text)
--> Bookmark -> Maybe Text
-forall a s. Getting a s a -> s -> a
-view Getting (Maybe Text) Bookmark (Maybe Text)
-Lens' Bookmark (Maybe Text)
-bookmarkName) [Bookmark]
-bms
-
--- | A predicate used by 'filterBookmarks' - match on the bookmark name.
--- Note that matching is case-sensitive.
-filterBookmarkByName :: Maybe T.Text -> Bookmark -> Bool
-filterBookmarkByName :: Maybe Text -> Bookmark -> Bool
-filterBookmarkByName Maybe Text
-Nothing = Bool -> Bookmark -> Bool
-forall a b. a -> b -> a
-const Bool
-True
-filterBookmarkByName (Just Text
-name) = (Maybe Text -> Maybe Text -> Bool)
--> (Maybe Text -> Maybe Text) -> Maybe Text -> Maybe Text -> Bool
-forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
-on Maybe Text -> Maybe Text -> Bool
-forall a. Eq a => a -> a -> Bool
-(==) ((Text -> Text) -> Maybe Text -> Maybe Text
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-fmap Text -> Text
-T.toLower) (Text -> Maybe Text
-forall a. a -> Maybe a
-Just Text
-name) (Maybe Text -> Bool)
--> (Bookmark -> Maybe Text) -> Bookmark -> Bool
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Getting (Maybe Text) Bookmark (Maybe Text)
--> Bookmark -> Maybe Text
-forall a s. Getting a s a -> s -> a
-view Getting (Maybe Text) Bookmark (Maybe Text)
-Lens' Bookmark (Maybe Text)
-bookmarkName
-
--- | A predicate used by 'filterBookmarks' - match on the bookmark directory.
-filterBookmarkByDirInfix :: Maybe T.Text -> Bookmark -> Bool
-filterBookmarkByDirInfix :: Maybe Text -> Bookmark -> Bool
-filterBookmarkByDirInfix Maybe Text
-Nothing = Bool -> Bookmark -> Bool
-forall a b. a -> b -> a
-const Bool
-True
-filterBookmarkByDirInfix (Just Text
-pref) =
-  (Text -> Text -> Bool) -> (Text -> Text) -> Text -> Text -> Bool
-forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
-on Text -> Text -> Bool
-T.isInfixOf ((Char -> Bool) -> Text -> Text
-T.dropWhileEnd (Char -> Char -> Bool
-forall a. Eq a => a -> a -> Bool
-== Char
-'/')) Text
-pref (Text -> Bool) -> (Bookmark -> Text) -> Bookmark -> Bool
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. FilePath -> Text
-T.pack (FilePath -> Text) -> (Bookmark -> FilePath) -> Bookmark -> Text
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Getting FilePath Bookmark FilePath -> Bookmark -> FilePath
-forall a s. Getting a s a -> s -> a
-view Getting FilePath Bookmark FilePath
-Lens' Bookmark FilePath
-bookmarkDirectory
-
--- | Given a bookmark name and a bookmark directory, test if a bookmark matches those
--- filters.
-filterBookmarks :: Maybe T.Text -> Maybe T.Text -> Bookmark -> Bool
-filterBookmarks :: Maybe Text -> Maybe Text -> Bookmark -> Bool
-filterBookmarks Maybe Text
-name Maybe Text
-dirInfix Bookmark
-bm = Maybe Text -> Bookmark -> Bool
-filterBookmarkByName Maybe Text
-name Bookmark
-bm
-                                     Bool -> Bool -> Bool
-&& Maybe Text -> Bookmark -> Bool
-filterBookmarkByDirInfix Maybe Text
-dirInfix Bookmark
-bm
-
--- | Convert a list of 'DefaultBookmark's to a 'Bookmarks', assiging indices and/
--- creation times on the fly.
-bookmarksFromDefault :: MonadIO m => [DefaultBookmark] -> m Bookmarks
-bookmarksFromDefault :: [DefaultBookmark] -> m Bookmarks
-bookmarksFromDefault [DefaultBookmark]
-dbms = [Bookmark] -> Bookmarks
-Bookmarks ([Bookmark] -> Bookmarks) -> m [Bookmark] -> m Bookmarks
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> m [Bookmark]
-bms
-  where
-    bms :: m [Bookmark]
-bms = [(DefaultBookmark, Int)]
--> ((DefaultBookmark, Int) -> m Bookmark) -> m [Bookmark]
-forall (t :: * -> *) (m :: * -> *) a b.
-(Traversable t, Monad m) =>
-t a -> (a -> m b) -> m (t b)
-forM ([DefaultBookmark] -> [Int] -> [(DefaultBookmark, Int)]
-forall a b. [a] -> [b] -> [(a, b)]
-zip [DefaultBookmark]
-dbms [Int
-1..]) (((DefaultBookmark, Int) -> m Bookmark) -> m [Bookmark])
--> ((DefaultBookmark, Int) -> m Bookmark) -> m [Bookmark]
-forall a b. (a -> b) -> a -> b
-$ \(DefaultBookmark FilePath
-dir Maybe Text
-name, Int
-idx) -> do
-      ZonedTime
-zTime <- IO ZonedTime -> m ZonedTime
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO IO ZonedTime
-getZonedTime
-      Bookmark -> m Bookmark
-forall (m :: * -> *) a. Monad m => a -> m a
-return (Bookmark -> m Bookmark) -> Bookmark -> m Bookmark
-forall a b. (a -> b) -> a -> b
-$ FilePath -> Int -> ZonedTime -> Maybe Text -> Bookmark
-Bookmark FilePath
-dir Int
-idx ZonedTime
-zTime Maybe Text
-name
-
--- | Get the bookmarks from the currently used bookmark file.
-getBookmarks :: HoYoMonad Bookmarks
-getBookmarks :: HoYoMonad Bookmarks
-getBookmarks = SimpleGetter Env Bookmarks -> HoYoMonad Bookmarks
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' SimpleGetter Env Bookmarks
-Lens' Env Bookmarks
-bookmarks
-
\ No newline at end of file diff --git a/docs/src/HoYo.Internal.Command.html b/docs/src/HoYo.Internal.Command.html deleted file mode 100644 index 514a06e..0000000 --- a/docs/src/HoYo.Internal.Command.html +++ /dev/null @@ -1,1326 +0,0 @@ -
{-|
-Module      : HoYo.Internal.Command
-Copyright   : (c) Frederick Pringle, 2023
-License     : BSD-3-Clause
-Maintainer  : freddyjepringle@gmail.com
-
-Internals used by the HoYo.Command module.
--}
-
-module HoYo.Internal.Command where
-
-import                          Control.Applicative
-import                          Control.Monad
-import                          Control.Monad.Except       (throwError)
-import                          Control.Monad.IO.Class
-import                          Control.Monad.Reader.Class (ask)
-
-import                          Data.Char                  (isDigit)
-import                          Data.Function
-import                          Data.List
-import                qualified Data.Text                  as T
-import                          Data.Time
-
-import                          HoYo.Bookmark
-import                          HoYo.Internal.Config
-import {-# SOURCE #-}           HoYo.Internal.Parse
-import                          HoYo.Internal.Types
-import                          HoYo.Internal.Utils
-
-import                          Lens.Micro
-import                          Lens.Micro.Extras
-
-import                          System.Directory
-import                          System.Exit
-
--- | Combine a config flag with a command-line flag, checking for conflicts.
-combOverride :: Bool -> Bool -> MaybeOverride
-combOverride :: Bool -> Bool -> MaybeOverride
-combOverride Bool
-False Bool
-False = MaybeOverride
-NoOverride
-combOverride Bool
-True  Bool
-False = MaybeOverride
-OverrideTrue
-combOverride Bool
-False Bool
-True  = MaybeOverride
-OverrideFalse
-combOverride Bool
-True  Bool
-True  = MaybeOverride
-Conflict
-
--- | Convert a 'MaybeOverride' to a function on 'Bool'.
-overrideFunc :: MaybeOverride -> (Bool -> Bool)
-overrideFunc :: MaybeOverride -> Bool -> Bool
-overrideFunc MaybeOverride
-NoOverride    = Bool -> Bool
-forall a. a -> a
-id
-overrideFunc MaybeOverride
-OverrideTrue  = Bool -> Bool -> Bool
-forall a b. a -> b -> a
-const Bool
-True
-overrideFunc MaybeOverride
-OverrideFalse = Bool -> Bool -> Bool
-forall a b. a -> b -> a
-const Bool
-False
-overrideFunc MaybeOverride
-Conflict      = [Char] -> Bool -> Bool
-forall a. HasCallStack => [Char] -> a
-error [Char]
-"override conflict!"
-
--- | Apply the override options to a 'Config'.
-overrideConfig :: OverrideOptions -> Config -> Config
-overrideConfig :: OverrideOptions -> Config -> Config
-overrideConfig OverrideOptions
-opts =
-  ASetter Config Config Bool Bool
--> (Bool -> Bool) -> Config -> Config
-forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
-over ASetter Config Config Bool Bool
-Lens' Config Bool
-failOnError            (MaybeOverride -> Bool -> Bool
-overrideFunc (MaybeOverride -> Bool -> Bool) -> MaybeOverride -> Bool -> Bool
-forall a b. (a -> b) -> a -> b
-$         OverrideOptions -> MaybeOverride
-overrideFailOnError OverrideOptions
-opts)
-  (Config -> Config) -> (Config -> Config) -> Config -> Config
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. ASetter Config Config Bool Bool
--> (Bool -> Bool) -> Config -> Config
-forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
-over ASetter Config Config Bool Bool
-Lens' Config Bool
-displayCreationTime  (MaybeOverride -> Bool -> Bool
-overrideFunc (MaybeOverride -> Bool -> Bool) -> MaybeOverride -> Bool -> Bool
-forall a b. (a -> b) -> a -> b
-$ OverrideOptions -> MaybeOverride
-overrideDisplayCreationTime OverrideOptions
-opts)
-  (Config -> Config) -> (Config -> Config) -> Config -> Config
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. ASetter Config Config Bool Bool
--> (Bool -> Bool) -> Config -> Config
-forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
-over ASetter Config Config Bool Bool
-Lens' Config Bool
-enableClearing       (MaybeOverride -> Bool -> Bool
-overrideFunc (MaybeOverride -> Bool -> Bool) -> MaybeOverride -> Bool -> Bool
-forall a b. (a -> b) -> a -> b
-$      OverrideOptions -> MaybeOverride
-overrideEnableClearing OverrideOptions
-opts)
-  (Config -> Config) -> (Config -> Config) -> Config -> Config
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. ASetter Config Config Bool Bool
--> (Bool -> Bool) -> Config -> Config
-forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
-over ASetter Config Config Bool Bool
-Lens' Config Bool
-enableReset          (MaybeOverride -> Bool -> Bool
-overrideFunc (MaybeOverride -> Bool -> Bool) -> MaybeOverride -> Bool -> Bool
-forall a b. (a -> b) -> a -> b
-$         OverrideOptions -> MaybeOverride
-overrideEnableReset OverrideOptions
-opts)
-  (Config -> Config) -> (Config -> Config) -> Config -> Config
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. ASetter Config Config Bool Bool
--> (Bool -> Bool) -> Config -> Config
-forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
-over ASetter Config Config Bool Bool
-Lens' Config Bool
-backupBeforeClear    (MaybeOverride -> Bool -> Bool
-overrideFunc (MaybeOverride -> Bool -> Bool) -> MaybeOverride -> Bool -> Bool
-forall a b. (a -> b) -> a -> b
-$   OverrideOptions -> MaybeOverride
-overrideBackupBeforeClear OverrideOptions
-opts)
-
--- | Apply the override options to an 'Env'.
-overrideEnv :: OverrideOptions -> Env -> Env
-overrideEnv :: OverrideOptions -> Env -> Env
-overrideEnv = ASetter Env Env Config Config -> (Config -> Config) -> Env -> Env
-forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
-over ASetter Env Env Config Config
-Lens' Env Config
-config ((Config -> Config) -> Env -> Env)
--> (OverrideOptions -> Config -> Config)
--> OverrideOptions
--> Env
--> Env
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. OverrideOptions -> Config -> Config
-overrideConfig
-
--- | Check that there are no conflicting overrides.
-verifyOverrides :: OverrideOptions -> Maybe T.Text
-verifyOverrides :: OverrideOptions -> Maybe Text
-verifyOverrides (OverrideOptions MaybeOverride
-o1 MaybeOverride
-o2 MaybeOverride
-o3 MaybeOverride
-o4 MaybeOverride
-o5) = MaybeOverride -> Maybe Text
-forall a. IsString a => MaybeOverride -> Maybe a
-verify MaybeOverride
-o1
-                                               Maybe Text -> Maybe Text -> Maybe Text
-forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
-<|> MaybeOverride -> Maybe Text
-forall a. IsString a => MaybeOverride -> Maybe a
-verify MaybeOverride
-o2
-                                               Maybe Text -> Maybe Text -> Maybe Text
-forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
-<|> MaybeOverride -> Maybe Text
-forall a. IsString a => MaybeOverride -> Maybe a
-verify MaybeOverride
-o3
-                                               Maybe Text -> Maybe Text -> Maybe Text
-forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
-<|> MaybeOverride -> Maybe Text
-forall a. IsString a => MaybeOverride -> Maybe a
-verify MaybeOverride
-o4
-                                               Maybe Text -> Maybe Text -> Maybe Text
-forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
-<|> MaybeOverride -> Maybe Text
-forall a. IsString a => MaybeOverride -> Maybe a
-verify MaybeOverride
-o5
-  where verify :: MaybeOverride -> Maybe a
-verify MaybeOverride
-Conflict = a -> Maybe a
-forall a. a -> Maybe a
-Just a
-"conflicting flags"
-        verify MaybeOverride
-_        = Maybe a
-forall a. Maybe a
-Nothing
-
--- | The default behaviour is to override nothing.
-defaultOverrideOptions :: OverrideOptions
-defaultOverrideOptions :: OverrideOptions
-defaultOverrideOptions = MaybeOverride
--> MaybeOverride
--> MaybeOverride
--> MaybeOverride
--> MaybeOverride
--> OverrideOptions
-OverrideOptions MaybeOverride
-NoOverride
-                                         MaybeOverride
-NoOverride
-                                         MaybeOverride
-NoOverride
-                                         MaybeOverride
-NoOverride
-                                         MaybeOverride
-NoOverride
-
--- | Default global options. In general this should do nothing.
-defaultGlobalOptions :: GlobalOptions
-defaultGlobalOptions :: GlobalOptions
-defaultGlobalOptions = Maybe [Char] -> Maybe [Char] -> OverrideOptions -> GlobalOptions
-GlobalOptions Maybe [Char]
-forall a. Maybe a
-Nothing Maybe [Char]
-forall a. Maybe a
-Nothing OverrideOptions
-defaultOverrideOptions
-
--- | Helper function whenever we need to modify the saved bookmarks.
---
--- @modifyBookmarks f@ retrieves the current bookmarks, applies @f@,
--- and saves them back to file.
-modifyBookmarks :: ([Bookmark] -> [Bookmark]) -> HoYoMonad ()
-modifyBookmarks :: ([Bookmark] -> [Bookmark]) -> HoYoMonad ()
-modifyBookmarks [Bookmark] -> [Bookmark]
-f = ([Bookmark] -> HoYoMonad [Bookmark]) -> HoYoMonad ()
-modifyBookmarksM ([Bookmark] -> HoYoMonad [Bookmark]
-forall (m :: * -> *) a. Monad m => a -> m a
-return ([Bookmark] -> HoYoMonad [Bookmark])
--> ([Bookmark] -> [Bookmark]) -> [Bookmark] -> HoYoMonad [Bookmark]
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. [Bookmark] -> [Bookmark]
-f)
-
--- | Helper function twhenever we need to modify the saved bookmarks,
--- and need access to the hoyo environment.
---
--- @modifyBookmarks f@ retrieves the current bookmarks, applies @f@
--- in the hoyo environment, and saves them back to file.
-modifyBookmarksM :: ([Bookmark] -> HoYoMonad [Bookmark]) -> HoYoMonad ()
-modifyBookmarksM :: ([Bookmark] -> HoYoMonad [Bookmark]) -> HoYoMonad ()
-modifyBookmarksM [Bookmark] -> HoYoMonad [Bookmark]
-f = do
-  Env (Bookmarks [Bookmark]
-bms) [Char]
-bFp Config
-_ [Char]
-_ <- HoYoMonad Env
-forall r (m :: * -> *). MonadReader r m => m r
-ask
-  Bookmarks
-newBookmarks <- [Bookmark] -> Bookmarks
-Bookmarks ([Bookmark] -> Bookmarks)
--> HoYoMonad [Bookmark] -> HoYoMonad Bookmarks
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> [Bookmark] -> HoYoMonad [Bookmark]
-f [Bookmark]
-bms
-  [Char] -> Bookmarks -> HoYoMonad ()
-forall (m :: * -> *). MonadIO m => [Char] -> Bookmarks -> m ()
-encodeBookmarksFile [Char]
-bFp Bookmarks
-newBookmarks
-
--- | Normalise a filepath and make sure it's a valid directory.
-normaliseAndVerifyDirectory :: FilePath -> HoYoMonad FilePath
-normaliseAndVerifyDirectory :: [Char] -> HoYoMonad [Char]
-normaliseAndVerifyDirectory [Char]
-d = do
-  [Char]
-dir <- IO [Char] -> HoYoMonad [Char]
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO [Char] -> HoYoMonad [Char]) -> IO [Char] -> HoYoMonad [Char]
-forall a b. (a -> b) -> a -> b
-$ [Char] -> IO [Char]
-canonicalizePath [Char]
-d
-  Text -> HoYoMonad Bool -> HoYoMonad Bool
-assertVerbose Text
-"not a directory" (HoYoMonad Bool -> HoYoMonad Bool)
--> HoYoMonad Bool -> HoYoMonad Bool
-forall a b. (a -> b) -> a -> b
-$ IO Bool -> HoYoMonad Bool
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO Bool -> HoYoMonad Bool) -> IO Bool -> HoYoMonad Bool
-forall a b. (a -> b) -> a -> b
-$ [Char] -> IO Bool
-doesDirectoryExist [Char]
-dir
-  [Char] -> HoYoMonad [Char]
-forall (m :: * -> *) a. Monad m => a -> m a
-return [Char]
-dir
-
--- | Take a name and make sure it's valid.
-verifyName :: T.Text -> HoYoMonad ()
-verifyName :: Text -> HoYoMonad ()
-verifyName Text
-name = do
-  let nameStr :: [Char]
-nameStr = Text -> [Char]
-T.unpack Text
-name
-  Text -> HoYoMonad Bool -> HoYoMonad ()
-assert Text
-"bookmark name can't be empty" (HoYoMonad Bool -> HoYoMonad ()) -> HoYoMonad Bool -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$ Bool -> HoYoMonad Bool
-forall (m :: * -> *) a. Monad m => a -> m a
-return (Bool -> HoYoMonad Bool) -> Bool -> HoYoMonad Bool
-forall a b. (a -> b) -> a -> b
-$ Bool -> Bool
-not (Bool -> Bool) -> Bool -> Bool
-forall a b. (a -> b) -> a -> b
-$ Text -> Bool
-T.null Text
-name
-  Text -> HoYoMonad Bool -> HoYoMonad ()
-assert Text
-"bookmark name can't be a number" (HoYoMonad Bool -> HoYoMonad ()) -> HoYoMonad Bool -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$ Bool -> HoYoMonad Bool
-forall (m :: * -> *) a. Monad m => a -> m a
-return (Bool -> HoYoMonad Bool) -> Bool -> HoYoMonad Bool
-forall a b. (a -> b) -> a -> b
-$ Bool -> Bool
-not (Bool -> Bool) -> Bool -> Bool
-forall a b. (a -> b) -> a -> b
-$ (Char -> Bool) -> [Char] -> Bool
-forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
-all Char -> Bool
-isDigit [Char]
-nameStr
-
--- | Given the existing bookmarks and a potential bookmark name,
--- test if the new bookmark will have a unique name.
-testNameUnique :: [Bookmark] -> T.Text -> HoYoMonad Bool
-testNameUnique :: [Bookmark] -> Text -> HoYoMonad Bool
-testNameUnique [Bookmark]
-bms Text
-name =
-  Text -> HoYoMonad Bool -> HoYoMonad Bool
-assertVerbose Text
-"bookmark name already used" (HoYoMonad Bool -> HoYoMonad Bool)
--> HoYoMonad Bool -> HoYoMonad Bool
-forall a b. (a -> b) -> a -> b
-$
-    Bool -> HoYoMonad Bool
-forall (m :: * -> *) a. Monad m => a -> m a
-return (Bool -> HoYoMonad Bool) -> Bool -> HoYoMonad Bool
-forall a b. (a -> b) -> a -> b
-$ (Bookmark -> Bool) -> [Bookmark] -> Bool
-forall (t :: * -> *) a. Foldable t => (a -> Bool) -> t a -> Bool
-all ((Maybe Text -> Maybe Text -> Bool
-forall a. Eq a => a -> a -> Bool
-/= Text -> Maybe Text
-forall a. a -> Maybe a
-Just Text
-name) (Maybe Text -> Bool)
--> (Bookmark -> Maybe Text) -> Bookmark -> Bool
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Getting (Maybe Text) Bookmark (Maybe Text)
--> Bookmark -> Maybe Text
-forall a s. Getting a s a -> s -> a
-view Getting (Maybe Text) Bookmark (Maybe Text)
-Lens' Bookmark (Maybe Text)
-bookmarkName) [Bookmark]
-bms
-
--- | Run the "add" command: add a new bookmark.
-runAdd :: AddOptions -> HoYoMonad ()
-runAdd :: AddOptions -> HoYoMonad ()
-runAdd AddOptions
-opts = do
-  [Char]
-dir <- [Char] -> HoYoMonad [Char]
-normaliseAndVerifyDirectory ([Char] -> HoYoMonad [Char]) -> [Char] -> HoYoMonad [Char]
-forall a b. (a -> b) -> a -> b
-$ AddOptions -> [Char]
-addDirectory AddOptions
-opts
-  let name :: Maybe Text
-name = AddOptions -> Maybe Text
-addName AddOptions
-opts
-  ([Bookmark] -> HoYoMonad [Bookmark]) -> HoYoMonad ()
-modifyBookmarksM (([Bookmark] -> HoYoMonad [Bookmark]) -> HoYoMonad ())
--> ([Bookmark] -> HoYoMonad [Bookmark]) -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$ \[Bookmark]
-bms -> do
-    Bool
-uniqName <- case Maybe Text
-name of Maybe Text
-Nothing -> Bool -> HoYoMonad Bool
-forall (m :: * -> *) a. Monad m => a -> m a
-return Bool
-True
-                             Just Text
-n  -> [Bookmark] -> Text -> HoYoMonad Bool
-testNameUnique [Bookmark]
-bms Text
-n
-    if Bool
-uniqName
-    then do
-      let maxIndex :: Int
-maxIndex = Int -> [Int] -> Int
-forall a. Ord a => a -> [a] -> a
-maximumDefault Int
-0 ([Int] -> Int) -> [Int] -> Int
-forall a b. (a -> b) -> a -> b
-$ (Bookmark -> Int) -> [Bookmark] -> [Int]
-forall a b. (a -> b) -> [a] -> [b]
-map (Getting Int Bookmark Int -> Bookmark -> Int
-forall a s. Getting a s a -> s -> a
-view Getting Int Bookmark Int
-Lens' Bookmark Int
-bookmarkIndex) [Bookmark]
-bms
-      ZonedTime
-zTime <- IO ZonedTime -> HoYoMonad ZonedTime
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO IO ZonedTime
-getZonedTime
-      let newBookMark :: Bookmark
-newBookMark = [Char] -> Int -> ZonedTime -> Maybe Text -> Bookmark
-Bookmark [Char]
-dir (Int
-maxIndex Int -> Int -> Int
-forall a. Num a => a -> a -> a
-+ Int
-1) ZonedTime
-zTime Maybe Text
-name
-      [Bookmark] -> HoYoMonad [Bookmark]
-forall (m :: * -> *) a. Monad m => a -> m a
-return (Bookmark
-newBookMark Bookmark -> [Bookmark] -> [Bookmark]
-forall a. a -> [a] -> [a]
-: [Bookmark]
-bms)
-    else [Bookmark] -> HoYoMonad [Bookmark]
-forall (m :: * -> *) a. Monad m => a -> m a
-return [Bookmark]
-bms
-
--- | Run the "move" command: search for a bookmark and @cd@ to it.
-runMove :: MoveOptions -> HoYoMonad ()
-runMove :: MoveOptions -> HoYoMonad ()
-runMove MoveOptions
-opts = do
-  Bookmarks
-bms <- SimpleGetter Env Bookmarks -> HoYoMonad Bookmarks
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' SimpleGetter Env Bookmarks
-Lens' Env Bookmarks
-bookmarks
-  let search :: BookmarkSearchTerm
-search = MoveOptions -> BookmarkSearchTerm
-moveSearch MoveOptions
-opts
-  case ([Bookmark], [Bookmark]) -> [Bookmark]
-forall a b. (a, b) -> a
-fst (([Bookmark], [Bookmark]) -> [Bookmark])
--> ([Bookmark], [Bookmark]) -> [Bookmark]
-forall a b. (a -> b) -> a -> b
-$ BookmarkSearchTerm -> Bookmarks -> ([Bookmark], [Bookmark])
-searchBookmarks BookmarkSearchTerm
-search Bookmarks
-bms of
-    []    -> Text -> HoYoMonad ()
-forall e (m :: * -> *) a. MonadError e m => e -> m a
-throwError (Text
-"Unknown bookmark: " Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> BookmarkSearchTerm -> Text
-forall a. Show a => a -> Text
-tshow BookmarkSearchTerm
-search)
-    [Bookmark
-bm]  -> do Text -> HoYoMonad ()
-forall (m :: * -> *). MonadIO m => Text -> m ()
-printStdout (Text
-"cd " Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> [Char] -> Text
-T.pack (Getting [Char] Bookmark [Char] -> Bookmark -> [Char]
-forall a s. Getting a s a -> s -> a
-view Getting [Char] Bookmark [Char]
-Lens' Bookmark [Char]
-bookmarkDirectory Bookmark
-bm))
-                IO () -> HoYoMonad ()
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO () -> HoYoMonad ()) -> IO () -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$ ExitCode -> IO ()
-forall a. ExitCode -> IO a
-exitWith (Int -> ExitCode
-ExitFailure Int
-3)
-    [Bookmark]
-ms    -> do Bool
-displayTime <- SimpleGetter Env Bool -> HoYoMonad Bool
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' ((Config -> Const r Config) -> Env -> Const r Env
-Lens' Env Config
-config ((Config -> Const r Config) -> Env -> Const r Env)
--> ((Bool -> Const r Bool) -> Config -> Const r Config)
--> (Bool -> Const r Bool)
--> Env
--> Const r Env
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. (Bool -> Const r Bool) -> Config -> Const r Config
-Lens' Config Bool
-displayCreationTime)
-                let strs :: [Text]
-strs = Bool -> [Bookmark] -> [Text]
-formatBookmarks Bool
-displayTime ([Bookmark] -> [Text]) -> [Bookmark] -> [Text]
-forall a b. (a -> b) -> a -> b
-$ (Bookmark -> Int) -> [Bookmark] -> [Bookmark]
-forall b a. Ord b => (a -> b) -> [a] -> [a]
-sortOn (Getting Int Bookmark Int -> Bookmark -> Int
-forall a s. Getting a s a -> s -> a
-view Getting Int Bookmark Int
-Lens' Bookmark Int
-bookmarkIndex) [Bookmark]
-ms
-                Text -> HoYoMonad ()
-forall e (m :: * -> *) a. MonadError e m => e -> m a
-throwError (Text -> HoYoMonad ()) -> Text -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$ Text -> [Text] -> Text
-T.intercalate Text
-"\n" (Text
-"multiple bookmarks matching search:" Text -> [Text] -> [Text]
-forall a. a -> [a] -> [a]
-: [Text]
-strs)
-
--- | Run the "list" command: list all the saved bookmarks.
-runList :: ListOptions -> HoYoMonad ()
-runList :: ListOptions -> HoYoMonad ()
-runList ListOptions
-opts = do
-  let filt :: Bookmark -> Bool
-filt = Maybe Text -> Maybe Text -> Bookmark -> Bool
-filterBookmarks (ListOptions -> Maybe Text
-listFilterName ListOptions
-opts) (ListOptions -> Maybe Text
-listFilterDirectoryInfix ListOptions
-opts)
-  Bookmarks
-bms' <- SimpleGetter Env Bookmarks -> HoYoMonad Bookmarks
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' SimpleGetter Env Bookmarks
-Lens' Env Bookmarks
-bookmarks
-  let bms :: [Bookmark]
-bms = (Bookmark -> Bool) -> [Bookmark] -> [Bookmark]
-forall a. (a -> Bool) -> [a] -> [a]
-filter Bookmark -> Bool
-filt ([Bookmark] -> [Bookmark]) -> [Bookmark] -> [Bookmark]
-forall a b. (a -> b) -> a -> b
-$ (Bookmark -> Int) -> [Bookmark] -> [Bookmark]
-forall b a. Ord b => (a -> b) -> [a] -> [a]
-sortOn (Getting Int Bookmark Int -> Bookmark -> Int
-forall a s. Getting a s a -> s -> a
-view Getting Int Bookmark Int
-Lens' Bookmark Int
-bookmarkIndex) ([Bookmark] -> [Bookmark]) -> [Bookmark] -> [Bookmark]
-forall a b. (a -> b) -> a -> b
-$ Bookmarks -> [Bookmark]
-unBookmarks Bookmarks
-bms'
-  Bool
-displayTime <- SimpleGetter Env Bool -> HoYoMonad Bool
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' ((Config -> Const r Config) -> Env -> Const r Env
-Lens' Env Config
-config ((Config -> Const r Config) -> Env -> Const r Env)
--> ((Bool -> Const r Bool) -> Config -> Const r Config)
--> (Bool -> Const r Bool)
--> Env
--> Const r Env
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. (Bool -> Const r Bool) -> Config -> Const r Config
-Lens' Config Bool
-displayCreationTime)
-  (Text -> HoYoMonad ()) -> [Text] -> HoYoMonad ()
-forall (t :: * -> *) (m :: * -> *) a b.
-(Foldable t, Monad m) =>
-(a -> m b) -> t a -> m ()
-mapM_ Text -> HoYoMonad ()
-forall (m :: * -> *). MonadIO m => Text -> m ()
-printStdout (Bool -> [Bookmark] -> [Text]
-formatBookmarks Bool
-displayTime [Bookmark]
-bms)
-
--- | Help text displayed when the user tries to run "hoyo clear"
--- when "enable_clear" is set to false.
-clearDisabledErrMsg :: T.Text
-clearDisabledErrMsg :: Text
-clearDisabledErrMsg = Text -> [Text] -> Text
-T.intercalate Text
-"\n" [
-  Text
-"The 'clear' command is disabled by default."
-  , Text
-"To enable, set enable_clear = true in the config or pass the --enable-clear flag."
-  ]
-
--- | Help text displayed when the user tries to run "hoyo config reset"
--- when "enable_reset" is set to false.
-resetDisabledErrMsg :: T.Text
-resetDisabledErrMsg :: Text
-resetDisabledErrMsg = Text -> [Text] -> Text
-T.intercalate Text
-"\n" [
-  Text
-"The 'config reset' command is disabled by default."
-  , Text
-"To enable, set enable_reset = true in the config or pass the --enable-reset flag."
-  ]
-
--- | Run the "clear" command: delete all the saved bookmarks.
-runClear :: ClearOptions -> HoYoMonad ()
-runClear :: ClearOptions -> HoYoMonad ()
-runClear ClearOptions
-_ = do
-  Text -> HoYoMonad Bool -> HoYoMonad ()
-assert Text
-clearDisabledErrMsg (SimpleGetter Env Bool -> HoYoMonad Bool
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' ((Config -> Const r Config) -> Env -> Const r Env
-Lens' Env Config
-config ((Config -> Const r Config) -> Env -> Const r Env)
--> ((Bool -> Const r Bool) -> Config -> Const r Config)
--> (Bool -> Const r Bool)
--> Env
--> Const r Env
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. (Bool -> Const r Bool) -> Config -> Const r Config
-Lens' Config Bool
-enableClearing))
-
-  [Char]
-path <- SimpleGetter Env [Char] -> HoYoMonad [Char]
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' SimpleGetter Env [Char]
-Lens' Env [Char]
-bookmarksPath
-  Bool
-backup <- SimpleGetter Env Bool -> HoYoMonad Bool
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' ((Config -> Const r Config) -> Env -> Const r Env
-Lens' Env Config
-config ((Config -> Const r Config) -> Env -> Const r Env)
--> ((Bool -> Const r Bool) -> Config -> Const r Config)
--> (Bool -> Const r Bool)
--> Env
--> Const r Env
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. (Bool -> Const r Bool) -> Config -> Const r Config
-Lens' Config Bool
-backupBeforeClear)
-  Bool -> HoYoMonad () -> HoYoMonad ()
-forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
-when Bool
-backup (HoYoMonad () -> HoYoMonad ()) -> HoYoMonad () -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$ [Char] -> [Char] -> HoYoMonad ()
-forall (m :: * -> *).
-(MonadIO m, MonadError Text m) =>
-[Char] -> [Char] -> m ()
-backupFile [Char]
-path [Char]
-"bkp"
-
-  ([Bookmark] -> [Bookmark]) -> HoYoMonad ()
-modifyBookmarks (([Bookmark] -> [Bookmark]) -> HoYoMonad ())
--> ([Bookmark] -> [Bookmark]) -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$ [Bookmark] -> [Bookmark] -> [Bookmark]
-forall a b. a -> b -> a
-const []
-  Bookmarks
-bms <- SimpleGetter Env [DefaultBookmark] -> HoYoMonad [DefaultBookmark]
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' ((Config -> Const r Config) -> Env -> Const r Env
-Lens' Env Config
-config ((Config -> Const r Config) -> Env -> Const r Env)
--> (([DefaultBookmark] -> Const r [DefaultBookmark])
-    -> Config -> Const r Config)
--> ([DefaultBookmark] -> Const r [DefaultBookmark])
--> Env
--> Const r Env
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. ([DefaultBookmark] -> Const r [DefaultBookmark])
--> Config -> Const r Config
-Lens' Config [DefaultBookmark]
-defaultBookmarks) HoYoMonad [DefaultBookmark]
--> ([DefaultBookmark] -> HoYoMonad Bookmarks)
--> HoYoMonad Bookmarks
-forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
->>= [DefaultBookmark] -> HoYoMonad Bookmarks
-forall (m :: * -> *). MonadIO m => [DefaultBookmark] -> m Bookmarks
-bookmarksFromDefault
-  [Char]
-fp <- SimpleGetter Env [Char] -> HoYoMonad [Char]
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' SimpleGetter Env [Char]
-Lens' Env [Char]
-bookmarksPath
-  [Char] -> Bookmarks -> HoYoMonad ()
-forall (m :: * -> *). MonadIO m => [Char] -> Bookmarks -> m ()
-encodeBookmarksFile [Char]
-fp Bookmarks
-bms
-
--- | Run the "delete" command: search for a bookmark and delete it.
-runDelete :: DeleteOptions -> HoYoMonad ()
-runDelete :: DeleteOptions -> HoYoMonad ()
-runDelete DeleteOptions
-opts = do
-  let search :: BookmarkSearchTerm
-search = DeleteOptions -> BookmarkSearchTerm
-deleteSearch DeleteOptions
-opts
-  ([Bookmark] -> HoYoMonad [Bookmark]) -> HoYoMonad ()
-modifyBookmarksM (([Bookmark] -> HoYoMonad [Bookmark]) -> HoYoMonad ())
--> ([Bookmark] -> HoYoMonad [Bookmark]) -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$ \[Bookmark]
-bms -> do
-    let ([Bookmark]
-searchResults, [Bookmark]
-afterDelete) = BookmarkSearchTerm -> Bookmarks -> ([Bookmark], [Bookmark])
-searchBookmarks BookmarkSearchTerm
-search ([Bookmark] -> Bookmarks
-Bookmarks [Bookmark]
-bms)
-    Text -> HoYoMonad Bool -> HoYoMonad Bool
-assertVerbose (Text
-"no bookmarks found for search " Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> BookmarkSearchTerm -> Text
-forall a. Show a => a -> Text
-tshow BookmarkSearchTerm
-search)
-      (HoYoMonad Bool -> HoYoMonad Bool)
--> HoYoMonad Bool -> HoYoMonad Bool
-forall a b. (a -> b) -> a -> b
-$ Bool -> HoYoMonad Bool
-forall (m :: * -> *) a. Monad m => a -> m a
-return (Bool -> HoYoMonad Bool) -> Bool -> HoYoMonad Bool
-forall a b. (a -> b) -> a -> b
-$ Bool -> Bool
-not (Bool -> Bool) -> Bool -> Bool
-forall a b. (a -> b) -> a -> b
-$ [Bookmark] -> Bool
-forall (t :: * -> *) a. Foldable t => t a -> Bool
-null [Bookmark]
-searchResults
-    Text -> HoYoMonad Bool -> HoYoMonad Bool
-assertVerbose (Text
-"multiple bookmarks found for search " Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> BookmarkSearchTerm -> Text
-forall a. Show a => a -> Text
-tshow BookmarkSearchTerm
-search)
-      (HoYoMonad Bool -> HoYoMonad Bool)
--> HoYoMonad Bool -> HoYoMonad Bool
-forall a b. (a -> b) -> a -> b
-$ Bool -> HoYoMonad Bool
-forall (m :: * -> *) a. Monad m => a -> m a
-return (Bool -> HoYoMonad Bool) -> Bool -> HoYoMonad Bool
-forall a b. (a -> b) -> a -> b
-$ [Bookmark] -> Int
-forall (t :: * -> *) a. Foldable t => t a -> Int
-length [Bookmark]
-searchResults Int -> Int -> Bool
-forall a. Eq a => a -> a -> Bool
-== Int
-1
-    [Bookmark] -> HoYoMonad [Bookmark]
-forall (m :: * -> *) a. Monad m => a -> m a
-return [Bookmark]
-afterDelete
-
--- | Run the "refresh" command: re-index bookmarks.
-runRefresh :: RefreshOptions -> HoYoMonad ()
-runRefresh :: RefreshOptions -> HoYoMonad ()
-runRefresh RefreshOptions
-_ = ([Bookmark] -> [Bookmark]) -> HoYoMonad ()
-modifyBookmarks (([Bookmark] -> [Bookmark]) -> HoYoMonad ())
--> ([Bookmark] -> [Bookmark]) -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$
-  (Int -> Bookmark -> Bookmark) -> [Int] -> [Bookmark] -> [Bookmark]
-forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
-zipWith (ASetter Bookmark Bookmark Int Int -> Int -> Bookmark -> Bookmark
-forall s t a b. ASetter s t a b -> b -> s -> t
-set ASetter Bookmark Bookmark Int Int
-Lens' Bookmark Int
-bookmarkIndex) [Int
-1..]                           -- re-index from 1
-    ([Bookmark] -> [Bookmark])
--> ([Bookmark] -> [Bookmark]) -> [Bookmark] -> [Bookmark]
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. (Bookmark -> Bookmark -> Bool) -> [Bookmark] -> [Bookmark]
-forall a. (a -> a -> Bool) -> [a] -> [a]
-nubBy ([Char] -> [Char] -> Bool
-forall a. Eq a => a -> a -> Bool
-(==) ([Char] -> [Char] -> Bool)
--> (Bookmark -> [Char]) -> Bookmark -> Bookmark -> Bool
-forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
-`on` Getting [Char] Bookmark [Char] -> Bookmark -> [Char]
-forall a s. Getting a s a -> s -> a
-view Getting [Char] Bookmark [Char]
-Lens' Bookmark [Char]
-bookmarkDirectory)                -- remove duplicate directories
-    ([Bookmark] -> [Bookmark])
--> ([Bookmark] -> [Bookmark]) -> [Bookmark] -> [Bookmark]
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. (Bookmark -> UTCTime) -> [Bookmark] -> [Bookmark]
-forall b a. Ord b => (a -> b) -> [a] -> [a]
-sortOn (ZonedTime -> UTCTime
-zonedTimeToUTC (ZonedTime -> UTCTime)
--> (Bookmark -> ZonedTime) -> Bookmark -> UTCTime
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Getting ZonedTime Bookmark ZonedTime -> Bookmark -> ZonedTime
-forall a s. Getting a s a -> s -> a
-view Getting ZonedTime Bookmark ZonedTime
-Lens' Bookmark ZonedTime
-bookmarkCreationTime)     -- sort by creation time
-
--- | Run the "config print" command: print the current config.
-runConfigPrint :: ConfigPrintOptions -> HoYoMonad ()
-runConfigPrint :: ConfigPrintOptions -> HoYoMonad ()
-runConfigPrint ConfigPrintOptions
-_ = do
-  Config
-s <- SimpleGetter Env Config -> HoYoMonad Config
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' SimpleGetter Env Config
-Lens' Env Config
-config
-  let keyVals :: [(Text, AnyConfigValue)]
-keyVals = Config -> [(Text, AnyConfigValue)]
-getKeyVals Config
-s
-  let keyWidth :: Int
-keyWidth = [Int] -> Int
-forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
-maximum ([Int] -> Int) -> [Int] -> Int
-forall a b. (a -> b) -> a -> b
-$ ((Text, AnyConfigValue) -> Int)
--> [(Text, AnyConfigValue)] -> [Int]
-forall a b. (a -> b) -> [a] -> [b]
-map (Text -> Int
-T.length (Text -> Int)
--> ((Text, AnyConfigValue) -> Text)
--> (Text, AnyConfigValue)
--> Int
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. (Text, AnyConfigValue) -> Text
-forall a b. (a, b) -> a
-fst) [(Text, AnyConfigValue)]
-keyVals
-  [(Text, AnyConfigValue)]
--> ((Text, AnyConfigValue) -> HoYoMonad ()) -> HoYoMonad ()
-forall (t :: * -> *) (m :: * -> *) a b.
-(Foldable t, Monad m) =>
-t a -> (a -> m b) -> m ()
-forM_ [(Text, AnyConfigValue)]
-keyVals (((Text, AnyConfigValue) -> HoYoMonad ()) -> HoYoMonad ())
--> ((Text, AnyConfigValue) -> HoYoMonad ()) -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$ \(Text
-key, AnyConfigValue
-val) -> do
-    let vStr :: Text
-vStr = AnyConfigValue -> Text
-formatConfigValue AnyConfigValue
-val
-    Text -> HoYoMonad ()
-forall (m :: * -> *). MonadIO m => Text -> m ()
-printStdout (Int -> Char -> Text -> Text
-T.justifyLeft Int
-keyWidth Char
-' ' Text
-key Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-" = " Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-vStr)
-
--- | Run the "config reset" command: reset the config to 'defaultConfig'.
-runConfigReset :: ConfigResetOptions -> HoYoMonad ()
-runConfigReset :: ConfigResetOptions -> HoYoMonad ()
-runConfigReset ConfigResetOptions
-_ = do
-  Text -> HoYoMonad Bool -> HoYoMonad ()
-assert Text
-resetDisabledErrMsg (SimpleGetter Env Bool -> HoYoMonad Bool
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' ((Config -> Const r Config) -> Env -> Const r Env
-Lens' Env Config
-config ((Config -> Const r Config) -> Env -> Const r Env)
--> ((Bool -> Const r Bool) -> Config -> Const r Config)
--> (Bool -> Const r Bool)
--> Env
--> Const r Env
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. (Bool -> Const r Bool) -> Config -> Const r Config
-Lens' Config Bool
-enableReset))
-
-  [Char]
-path <- SimpleGetter Env [Char] -> HoYoMonad [Char]
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' SimpleGetter Env [Char]
-Lens' Env [Char]
-configPath
-
-  Bool
-backup <- SimpleGetter Env Bool -> HoYoMonad Bool
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' ((Config -> Const r Config) -> Env -> Const r Env
-Lens' Env Config
-config ((Config -> Const r Config) -> Env -> Const r Env)
--> ((Bool -> Const r Bool) -> Config -> Const r Config)
--> (Bool -> Const r Bool)
--> Env
--> Const r Env
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. (Bool -> Const r Bool) -> Config -> Const r Config
-Lens' Config Bool
-backupBeforeClear)
-  Bool -> HoYoMonad () -> HoYoMonad ()
-forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
-when Bool
-backup (HoYoMonad () -> HoYoMonad ()) -> HoYoMonad () -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$ [Char] -> [Char] -> HoYoMonad ()
-forall (m :: * -> *).
-(MonadIO m, MonadError Text m) =>
-[Char] -> [Char] -> m ()
-backupFile [Char]
-path [Char]
-"bkp"
-
-  [Char] -> Config -> HoYoMonad ()
-forall (m :: * -> *). MonadIO m => [Char] -> Config -> m ()
-encodeConfigFile [Char]
-path Config
-defaultConfig
-
--- | Run the "config set" command: try to set a key-value pair in the config.
-runConfigSet :: ConfigSetOptions -> HoYoMonad ()
-runConfigSet :: ConfigSetOptions -> HoYoMonad ()
-runConfigSet ConfigSetOptions
-opts = do
-  let key :: Text
-key = ConfigSetOptions -> Text
-setKey ConfigSetOptions
-opts
-  let val :: Text
-val = ConfigSetOptions -> Text
-setValue ConfigSetOptions
-opts
-  [Char]
-cfgPath <- SimpleGetter Env [Char] -> HoYoMonad [Char]
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' SimpleGetter Env [Char]
-Lens' Env [Char]
-configPath
-  SimpleGetter Env Config -> HoYoMonad Config
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' SimpleGetter Env Config
-Lens' Env Config
-config
-    HoYoMonad Config
--> (Config -> HoYoMonad Config) -> HoYoMonad Config
-forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
->>= Text -> Text -> Config -> HoYoMonad Config
-forall (m :: * -> *).
-MonadError Text m =>
-Text -> Text -> Config -> m Config
-setConfig Text
-key Text
-val
-    HoYoMonad Config -> (Config -> HoYoMonad ()) -> HoYoMonad ()
-forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
->>= [Char] -> Config -> HoYoMonad ()
-forall (m :: * -> *). MonadIO m => [Char] -> Config -> m ()
-encodeConfigFile [Char]
-cfgPath
-
--- | Run the "config add-default" command: try to set a key-value pair in the config.
-runAddDefault :: ConfigAddDefaultOptions -> HoYoMonad ()
-runAddDefault :: ConfigAddDefaultOptions -> HoYoMonad ()
-runAddDefault ConfigAddDefaultOptions
-opts = do
-  [Char]
-dir <- [Char] -> HoYoMonad [Char]
-normaliseAndVerifyDirectory ([Char] -> HoYoMonad [Char]) -> [Char] -> HoYoMonad [Char]
-forall a b. (a -> b) -> a -> b
-$ ConfigAddDefaultOptions -> [Char]
-addDefaultDir ConfigAddDefaultOptions
-opts
-
-  let name :: Maybe Text
-name = ConfigAddDefaultOptions -> Maybe Text
-addDefaultName ConfigAddDefaultOptions
-opts
-  let defaultBm :: DefaultBookmark
-defaultBm = [Char] -> Maybe Text -> DefaultBookmark
-DefaultBookmark [Char]
-dir Maybe Text
-name
-  [Char]
-cfgPath <- SimpleGetter Env [Char] -> HoYoMonad [Char]
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' SimpleGetter Env [Char]
-Lens' Env [Char]
-configPath
-  SimpleGetter Env Config -> HoYoMonad Config
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' SimpleGetter Env Config
-Lens' Env Config
-config
-    HoYoMonad Config -> (Config -> HoYoMonad ()) -> HoYoMonad ()
-forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
->>= [Char] -> Config -> HoYoMonad ()
-forall (m :: * -> *). MonadIO m => [Char] -> Config -> m ()
-encodeConfigFile [Char]
-cfgPath (Config -> HoYoMonad ())
--> (Config -> Config) -> Config -> HoYoMonad ()
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. ASetter Config Config [DefaultBookmark] [DefaultBookmark]
--> ([DefaultBookmark] -> [DefaultBookmark]) -> Config -> Config
-forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
-over ASetter Config Config [DefaultBookmark] [DefaultBookmark]
-Lens' Config [DefaultBookmark]
-defaultBookmarks (DefaultBookmark
-defaultBm DefaultBookmark -> [DefaultBookmark] -> [DefaultBookmark]
-forall a. a -> [a] -> [a]
-:)
-
--- | Run the "config" command: dispatch on the given sub-command.
-runConfig :: ConfigCommand -> HoYoMonad ()
-runConfig :: ConfigCommand -> HoYoMonad ()
-runConfig (Print ConfigPrintOptions
-opts)              = ConfigPrintOptions -> HoYoMonad ()
-runConfigPrint ConfigPrintOptions
-opts
-runConfig (Reset ConfigResetOptions
-opts)              = ConfigResetOptions -> HoYoMonad ()
-runConfigReset ConfigResetOptions
-opts
-runConfig (Set ConfigSetOptions
-opts)                = ConfigSetOptions -> HoYoMonad ()
-runConfigSet ConfigSetOptions
-opts
-runConfig (AddDefaultBookmark ConfigAddDefaultOptions
-opts) = ConfigAddDefaultOptions -> HoYoMonad ()
-runAddDefault ConfigAddDefaultOptions
-opts
-
--- | Check that the config file is valid.
-runCheckConfig :: FilePath -> IO ()
-runCheckConfig :: [Char] -> IO ()
-runCheckConfig = [Char] -> IO (Either Text Config)
-forall (m :: * -> *). MonadIO m => [Char] -> m (Either Text Config)
-decodeConfigFile ([Char] -> IO (Either Text Config))
--> (Either Text Config -> IO ()) -> [Char] -> IO ()
-forall (m :: * -> *) a b c.
-Monad m =>
-(a -> m b) -> (b -> m c) -> a -> m c
->=> \case
-  Left Text
-err -> Text -> IO ()
-forall (m :: * -> *). MonadIO m => Text -> m ()
-printStderr Text
-err
-  Right Config
-_  -> Text -> IO ()
-forall (m :: * -> *). MonadIO m => Text -> m ()
-printStdout Text
-"Config is good"
-
--- | Check that the bookmarks file is valid.
-runCheckBookmarks :: FilePath -> IO ()
-runCheckBookmarks :: [Char] -> IO ()
-runCheckBookmarks = [Char] -> IO (Either Text Bookmarks)
-forall (m :: * -> *).
-MonadIO m =>
-[Char] -> m (Either Text Bookmarks)
-decodeBookmarksFile ([Char] -> IO (Either Text Bookmarks))
--> (Either Text Bookmarks -> IO ()) -> [Char] -> IO ()
-forall (m :: * -> *) a b c.
-Monad m =>
-(a -> m b) -> (b -> m c) -> a -> m c
->=> \case
-  Left Text
-err -> Text -> IO ()
-forall (m :: * -> *). MonadIO m => Text -> m ()
-printStderr Text
-err
-  Right Bookmarks
-_  -> Text -> IO ()
-forall (m :: * -> *). MonadIO m => Text -> m ()
-printStdout Text
-"Bookmarks file is good"
-
--- | Run the "config check" command: validate the current
--- config and bookmarks files.
-runCheck :: CheckOptions -> FilePath -> FilePath -> IO ()
-runCheck :: CheckOptions -> [Char] -> [Char] -> IO ()
-runCheck CheckOptions
-opts [Char]
-bFp [Char]
-sFp = do
-  Bool -> IO () -> IO ()
-forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
-when (CheckOptions -> Bool
-checkConfig CheckOptions
-opts) (IO () -> IO ()) -> IO () -> IO ()
-forall a b. (a -> b) -> a -> b
-$ [Char] -> IO ()
-runCheckConfig [Char]
-sFp
-  Bool -> IO () -> IO ()
-forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
-when (CheckOptions -> Bool
-checkBookmarks CheckOptions
-opts) (IO () -> IO ()) -> IO () -> IO ()
-forall a b. (a -> b) -> a -> b
-$ [Char] -> IO ()
-runCheckBookmarks [Char]
-bFp
-
--- | Run the default command, if it has been specified by the user.
-runDefaultCommand :: HoYoMonad ()
-runDefaultCommand :: HoYoMonad ()
-runDefaultCommand = SimpleGetter Env (Maybe Command) -> HoYoMonad (Maybe Command)
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' ((Config -> Const r Config) -> Env -> Const r Env
-Lens' Env Config
-config ((Config -> Const r Config) -> Env -> Const r Env)
--> ((Maybe Command -> Const r (Maybe Command))
-    -> Config -> Const r Config)
--> (Maybe Command -> Const r (Maybe Command))
--> Env
--> Const r Env
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. (Maybe Command -> Const r (Maybe Command))
--> Config -> Const r Config
-Lens' Config (Maybe Command)
-defaultCommand) HoYoMonad (Maybe Command)
--> (Maybe Command -> HoYoMonad ()) -> HoYoMonad ()
-forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
->>= \case
-  Maybe Command
-Nothing             -> IO () -> HoYoMonad ()
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO () -> HoYoMonad ()) -> IO () -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$ Maybe [Char] -> IO ()
-showHelp Maybe [Char]
-forall a. Maybe a
-Nothing
-  Just Command
-DefaultCommand -> Text -> HoYoMonad ()
-forall e (m :: * -> *) a. MonadError e m => e -> m a
-throwError Text
-"default command: stuck in a loop!"
-  Just Command
-otherCommand   -> Command -> HoYoMonad ()
-runCommand Command
-otherCommand
-
--- | Run the "help" command: get help on a specific subcommand.
-runHelp :: HelpOptions -> HoYoMonad ()
-runHelp :: HelpOptions -> HoYoMonad ()
-runHelp (HelpOptions Maybe Text
-cmd) = IO () -> HoYoMonad ()
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO () -> HoYoMonad ()) -> IO () -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$ Maybe [Char] -> IO ()
-showHelp (Text -> [Char]
-T.unpack (Text -> [Char]) -> Maybe Text -> Maybe [Char]
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Maybe Text
-cmd)
-
--- | Run a 'Command' in the hoyo environment.
-runCommand :: Command -> HoYoMonad ()
-runCommand :: Command -> HoYoMonad ()
-runCommand       (Add AddOptions
-opts) = AddOptions -> HoYoMonad ()
-runAdd AddOptions
-opts
-runCommand      (Move MoveOptions
-opts) = MoveOptions -> HoYoMonad ()
-runMove MoveOptions
-opts
-runCommand      (List ListOptions
-opts) = ListOptions -> HoYoMonad ()
-runList ListOptions
-opts
-runCommand     (Clear ClearOptions
-opts) = ClearOptions -> HoYoMonad ()
-runClear ClearOptions
-opts
-runCommand    (Delete DeleteOptions
-opts) = DeleteOptions -> HoYoMonad ()
-runDelete DeleteOptions
-opts
-runCommand   (Refresh RefreshOptions
-opts) = RefreshOptions -> HoYoMonad ()
-runRefresh RefreshOptions
-opts
-runCommand (ConfigCmd ConfigCommand
-opts) = ConfigCommand -> HoYoMonad ()
-runConfig ConfigCommand
-opts
-runCommand   Command
-DefaultCommand = HoYoMonad ()
-runDefaultCommand
-runCommand      (Help HelpOptions
-opts) = HelpOptions -> HoYoMonad ()
-runHelp HelpOptions
-opts
-runCommand     (Check CheckOptions
-opts) = do
-  -- printStderr "The 'check' command should be run outside the HoYo monad."
-  Text -> HoYoMonad ()
-forall (m :: * -> *). MonadIO m => Text -> m ()
-printStderr Text
-"It's discouraged to set default_command = \"check\" in your hoyo config file."
-  Env Bookmarks
-_ [Char]
-bFp Config
-_ [Char]
-sFp <- HoYoMonad Env
-forall r (m :: * -> *). MonadReader r m => m r
-ask
-  IO () -> HoYoMonad ()
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO () -> HoYoMonad ()) -> IO () -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$ CheckOptions -> [Char] -> [Char] -> IO ()
-runCheck CheckOptions
-opts [Char]
-bFp [Char]
-sFp
-
\ No newline at end of file diff --git a/docs/src/HoYo.Internal.Config.html b/docs/src/HoYo.Internal.Config.html deleted file mode 100644 index 473dd97..0000000 --- a/docs/src/HoYo.Internal.Config.html +++ /dev/null @@ -1,674 +0,0 @@ -
{-|
-Module      : HoYo.Internal.Config
-Copyright   : (c) Frederick Pringle, 2023
-License     : BSD-3-Clause
-Maintainer  : freddyjepringle@gmail.com
-
-Internals used by the HoYo.Config module.
--}
-
-{-# LANGUAGE RankNTypes    #-}
-{-# LANGUAGE TupleSections #-}
-module HoYo.Internal.Config where
-
-import                          Control.Category       ((<<<))
-import                          Control.Monad
-import                          Control.Monad.Except
-
-import                          Data.Bifunctor         (first)
-import                          Data.Maybe             (maybeToList)
-import                qualified Data.Text              as T
-
-import                          HoYo.Internal.Bookmark
-import {-# SOURCE #-}           HoYo.Internal.Parse
-import                          HoYo.Internal.Types
-import                          HoYo.Internal.Utils
-
-import                          Lens.Micro
-import                          Lens.Micro.Extras
-
-import                          Options.Applicative
-
-import                qualified Toml
-import                          Toml                   (TomlCodec, (.=))
-
--- | A TOML codec describing how to convert a 'Config' to and from its
--- TOML representation.
-configCodec :: TomlCodec Config
-configCodec :: TomlCodec Config
-configCodec = ConfigValue 'TBool
--> ConfigValue 'TBool
--> ConfigValue 'TBool
--> ConfigValue 'TBool
--> ConfigValue 'TBool
--> ConfigValue ('TList 'TDefaultBookmark)
--> ConfigValue ('TMaybe 'TCommand)
--> Config
-Config
-  (ConfigValue 'TBool
- -> ConfigValue 'TBool
- -> ConfigValue 'TBool
- -> ConfigValue 'TBool
- -> ConfigValue 'TBool
- -> ConfigValue ('TList 'TDefaultBookmark)
- -> ConfigValue ('TMaybe 'TCommand)
- -> Config)
--> Codec Config (ConfigValue 'TBool)
--> Codec
-     Config
-     (ConfigValue 'TBool
-      -> ConfigValue 'TBool
-      -> ConfigValue 'TBool
-      -> ConfigValue 'TBool
-      -> ConfigValue ('TList 'TDefaultBookmark)
-      -> ConfigValue ('TMaybe 'TCommand)
-      -> Config)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> (Bool -> ConfigValue 'TBool
-BoolV (Bool -> ConfigValue 'TBool)
--> Codec Bool Bool -> Codec Bool (ConfigValue 'TBool)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Key -> Codec Bool Bool
-Toml.bool Key
-"fail_on_error")           Codec Bool (ConfigValue 'TBool)
--> (Config -> Bool) -> Codec Config (ConfigValue 'TBool)
-forall field a object.
-Codec field a -> (object -> field) -> Codec object a
-.= Getting Bool Config Bool -> Config -> Bool
-forall a s. Getting a s a -> s -> a
-view Getting Bool Config Bool
-Lens' Config Bool
-failOnError
-  Codec
-  Config
-  (ConfigValue 'TBool
-   -> ConfigValue 'TBool
-   -> ConfigValue 'TBool
-   -> ConfigValue 'TBool
-   -> ConfigValue ('TList 'TDefaultBookmark)
-   -> ConfigValue ('TMaybe 'TCommand)
-   -> Config)
--> Codec Config (ConfigValue 'TBool)
--> Codec
-     Config
-     (ConfigValue 'TBool
-      -> ConfigValue 'TBool
-      -> ConfigValue 'TBool
-      -> ConfigValue ('TList 'TDefaultBookmark)
-      -> ConfigValue ('TMaybe 'TCommand)
-      -> Config)
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> (Bool -> ConfigValue 'TBool
-BoolV (Bool -> ConfigValue 'TBool)
--> Codec Bool Bool -> Codec Bool (ConfigValue 'TBool)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Key -> Codec Bool Bool
-Toml.bool Key
-"display_creation_time")   Codec Bool (ConfigValue 'TBool)
--> (Config -> Bool) -> Codec Config (ConfigValue 'TBool)
-forall field a object.
-Codec field a -> (object -> field) -> Codec object a
-.= Getting Bool Config Bool -> Config -> Bool
-forall a s. Getting a s a -> s -> a
-view Getting Bool Config Bool
-Lens' Config Bool
-displayCreationTime
-  Codec
-  Config
-  (ConfigValue 'TBool
-   -> ConfigValue 'TBool
-   -> ConfigValue 'TBool
-   -> ConfigValue ('TList 'TDefaultBookmark)
-   -> ConfigValue ('TMaybe 'TCommand)
-   -> Config)
--> Codec Config (ConfigValue 'TBool)
--> Codec
-     Config
-     (ConfigValue 'TBool
-      -> ConfigValue 'TBool
-      -> ConfigValue ('TList 'TDefaultBookmark)
-      -> ConfigValue ('TMaybe 'TCommand)
-      -> Config)
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> (Bool -> ConfigValue 'TBool
-BoolV (Bool -> ConfigValue 'TBool)
--> Codec Bool Bool -> Codec Bool (ConfigValue 'TBool)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Key -> Codec Bool Bool
-Toml.bool Key
-"enable_clearing")         Codec Bool (ConfigValue 'TBool)
--> (Config -> Bool) -> Codec Config (ConfigValue 'TBool)
-forall field a object.
-Codec field a -> (object -> field) -> Codec object a
-.= Getting Bool Config Bool -> Config -> Bool
-forall a s. Getting a s a -> s -> a
-view Getting Bool Config Bool
-Lens' Config Bool
-enableClearing
-  Codec
-  Config
-  (ConfigValue 'TBool
-   -> ConfigValue 'TBool
-   -> ConfigValue ('TList 'TDefaultBookmark)
-   -> ConfigValue ('TMaybe 'TCommand)
-   -> Config)
--> Codec Config (ConfigValue 'TBool)
--> Codec
-     Config
-     (ConfigValue 'TBool
-      -> ConfigValue ('TList 'TDefaultBookmark)
-      -> ConfigValue ('TMaybe 'TCommand)
-      -> Config)
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> (Bool -> ConfigValue 'TBool
-BoolV (Bool -> ConfigValue 'TBool)
--> Codec Bool Bool -> Codec Bool (ConfigValue 'TBool)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Key -> Codec Bool Bool
-Toml.bool Key
-"enable_reset")            Codec Bool (ConfigValue 'TBool)
--> (Config -> Bool) -> Codec Config (ConfigValue 'TBool)
-forall field a object.
-Codec field a -> (object -> field) -> Codec object a
-.= Getting Bool Config Bool -> Config -> Bool
-forall a s. Getting a s a -> s -> a
-view Getting Bool Config Bool
-Lens' Config Bool
-enableReset
-  Codec
-  Config
-  (ConfigValue 'TBool
-   -> ConfigValue ('TList 'TDefaultBookmark)
-   -> ConfigValue ('TMaybe 'TCommand)
-   -> Config)
--> Codec Config (ConfigValue 'TBool)
--> Codec
-     Config
-     (ConfigValue ('TList 'TDefaultBookmark)
-      -> ConfigValue ('TMaybe 'TCommand) -> Config)
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> (Bool -> ConfigValue 'TBool
-BoolV (Bool -> ConfigValue 'TBool)
--> Codec Bool Bool -> Codec Bool (ConfigValue 'TBool)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Key -> Codec Bool Bool
-Toml.bool Key
-"backup_before_clear")     Codec Bool (ConfigValue 'TBool)
--> (Config -> Bool) -> Codec Config (ConfigValue 'TBool)
-forall field a object.
-Codec field a -> (object -> field) -> Codec object a
-.= Getting Bool Config Bool -> Config -> Bool
-forall a s. Getting a s a -> s -> a
-view Getting Bool Config Bool
-Lens' Config Bool
-backupBeforeClear
-  Codec
-  Config
-  (ConfigValue ('TList 'TDefaultBookmark)
-   -> ConfigValue ('TMaybe 'TCommand) -> Config)
--> Codec Config (ConfigValue ('TList 'TDefaultBookmark))
--> Codec Config (ConfigValue ('TMaybe 'TCommand) -> Config)
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> ([ConfigValue 'TDefaultBookmark]
--> ConfigValue ('TList 'TDefaultBookmark)
-forall (a :: ConfigValueType).
-[ConfigValue a] -> ConfigValue ('TList a)
-ListOfV ([ConfigValue 'TDefaultBookmark]
- -> ConfigValue ('TList 'TDefaultBookmark))
--> ([DefaultBookmark] -> [ConfigValue 'TDefaultBookmark])
--> [DefaultBookmark]
--> ConfigValue ('TList 'TDefaultBookmark)
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. (DefaultBookmark -> ConfigValue 'TDefaultBookmark)
--> [DefaultBookmark] -> [ConfigValue 'TDefaultBookmark]
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-fmap DefaultBookmark -> ConfigValue 'TDefaultBookmark
-DefaultBookmarkV ([DefaultBookmark] -> ConfigValue ('TList 'TDefaultBookmark))
--> Codec [DefaultBookmark] [DefaultBookmark]
--> Codec [DefaultBookmark] (ConfigValue ('TList 'TDefaultBookmark))
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> TomlCodec DefaultBookmark
--> Key -> Codec [DefaultBookmark] [DefaultBookmark]
-forall a. TomlCodec a -> Key -> TomlCodec [a]
-Toml.list TomlCodec DefaultBookmark
-defaultBookmarkCodec Key
-"default_bookmark") Codec [DefaultBookmark] (ConfigValue ('TList 'TDefaultBookmark))
--> (Config -> [DefaultBookmark])
--> Codec Config (ConfigValue ('TList 'TDefaultBookmark))
-forall field a object.
-Codec field a -> (object -> field) -> Codec object a
-.= Getting [DefaultBookmark] Config [DefaultBookmark]
--> Config -> [DefaultBookmark]
-forall a s. Getting a s a -> s -> a
-view Getting [DefaultBookmark] Config [DefaultBookmark]
-Lens' Config [DefaultBookmark]
-defaultBookmarks
-  Codec Config (ConfigValue ('TMaybe 'TCommand) -> Config)
--> Codec Config (ConfigValue ('TMaybe 'TCommand))
--> TomlCodec Config
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> (Maybe (ConfigValue 'TCommand) -> ConfigValue ('TMaybe 'TCommand)
-forall (a :: ConfigValueType).
-Maybe (ConfigValue a) -> ConfigValue ('TMaybe a)
-MaybeV (Maybe (ConfigValue 'TCommand) -> ConfigValue ('TMaybe 'TCommand))
--> (Maybe Command -> Maybe (ConfigValue 'TCommand))
--> Maybe Command
--> ConfigValue ('TMaybe 'TCommand)
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. (Command -> ConfigValue 'TCommand)
--> Maybe Command -> Maybe (ConfigValue 'TCommand)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-fmap Command -> ConfigValue 'TCommand
-CommandV (Maybe Command -> ConfigValue ('TMaybe 'TCommand))
--> Codec (Maybe Command) (Maybe Command)
--> Codec (Maybe Command) (ConfigValue ('TMaybe 'TCommand))
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> TomlCodec Command -> Codec (Maybe Command) (Maybe Command)
-forall a. TomlCodec a -> TomlCodec (Maybe a)
-Toml.dioptional (Key -> TomlCodec Command
-commandCodec Key
-"default_command")) Codec (Maybe Command) (ConfigValue ('TMaybe 'TCommand))
--> (Config -> Maybe Command)
--> Codec Config (ConfigValue ('TMaybe 'TCommand))
-forall field a object.
-Codec field a -> (object -> field) -> Codec object a
-.= Getting (Maybe Command) Config (Maybe Command)
--> Config -> Maybe Command
-forall a s. Getting a s a -> s -> a
-view Getting (Maybe Command) Config (Maybe Command)
-Lens' Config (Maybe Command)
-defaultCommand
-
--- | Toml codec using optparse-applicative to parse a default command. Incurs a cyclic
--- dependency which is resolved using Parse.hs-boot.
-commandCodec :: Toml.Key -> TomlCodec Command
-commandCodec :: Key -> TomlCodec Command
-commandCodec = TomlBiMap Command AnyValue -> Key -> TomlCodec Command
-forall a. TomlBiMap a AnyValue -> Key -> TomlCodec a
-Toml.match (TomlBiMap Text AnyValue
-Toml._Text TomlBiMap Text AnyValue
--> BiMap TomlBiMapError Command Text -> TomlBiMap Command AnyValue
-forall k (cat :: k -> k -> *) (b :: k) (c :: k) (a :: k).
-Category cat =>
-cat b c -> cat a b -> cat a c
-<<< BiMap TomlBiMapError Text Command
--> BiMap TomlBiMapError Command Text
-forall e a b. BiMap e a b -> BiMap e b a
-Toml.invert ((Command -> Text)
--> (Text -> Either TomlBiMapError Command)
--> BiMap TomlBiMapError Text Command
-forall field object error.
-(field -> object)
--> (object -> Either error field) -> BiMap error object field
-Toml.prism Command -> Text
-fmt Text -> Either TomlBiMapError Command
-prs))
-  where
-    fmt :: Command -> T.Text
-    fmt :: Command -> Text
-fmt = [Text] -> Text
-formatArgs ([Text] -> Text) -> (Command -> [Text]) -> Command -> Text
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Command -> [Text]
-formatCommand
-
-    prs :: T.Text -> Either Toml.TomlBiMapError Command
-    prs :: Text -> Either TomlBiMapError Command
-prs Text
-t = case ParserPrefs
--> ParserInfo Command -> [String] -> ParserResult Command
-forall a. ParserPrefs -> ParserInfo a -> [String] -> ParserResult a
-execParserPure ParserPrefs
-defaultPrefs (Parser Command -> InfoMod Command -> ParserInfo Command
-forall a. Parser a -> InfoMod a -> ParserInfo a
-info Parser Command
-parseCommand InfoMod Command
-forall a. Monoid a => a
-mempty) (Text -> [String]
-splitArgs Text
-t) of
-      Success Command
-cmd -> Command -> Either TomlBiMapError Command
-forall a b. b -> Either a b
-Right Command
-cmd
-      Failure ParserFailure ParserHelp
-err -> do let (String
-msg, ExitCode
-_) = ParserFailure ParserHelp -> String -> (String, ExitCode)
-renderFailure ParserFailure ParserHelp
-err String
-"hoyo"
-                        TomlBiMapError -> Either TomlBiMapError Command
-forall a b. a -> Either a b
-Left (Text -> TomlBiMapError
-Toml.ArbitraryError (Text -> TomlBiMapError) -> Text -> TomlBiMapError
-forall a b. (a -> b) -> a -> b
-$ String -> Text
-T.pack String
-msg)
-      CompletionInvoked CompletionResult
-res -> TomlBiMapError -> Either TomlBiMapError Command
-forall a b. a -> Either a b
-Left (Text -> TomlBiMapError
-Toml.ArbitraryError (Text -> TomlBiMapError) -> Text -> TomlBiMapError
-forall a b. (a -> b) -> a -> b
-$ CompletionResult -> Text
-forall a. Show a => a -> Text
-tshow CompletionResult
-res)
-
--- | The default config for hoyo.
-defaultConfig :: Config
-defaultConfig :: Config
-defaultConfig = Config :: ConfigValue 'TBool
--> ConfigValue 'TBool
--> ConfigValue 'TBool
--> ConfigValue 'TBool
--> ConfigValue 'TBool
--> ConfigValue ('TList 'TDefaultBookmark)
--> ConfigValue ('TMaybe 'TCommand)
--> Config
-Config {
-  _failOnError :: ConfigValue 'TBool
-_failOnError                = Bool -> ConfigValue 'TBool
-BoolV Bool
-False
-  , _displayCreationTime :: ConfigValue 'TBool
-_displayCreationTime      = Bool -> ConfigValue 'TBool
-BoolV Bool
-False
-  , _enableClearing :: ConfigValue 'TBool
-_enableClearing           = Bool -> ConfigValue 'TBool
-BoolV Bool
-False
-  , _enableReset :: ConfigValue 'TBool
-_enableReset              = Bool -> ConfigValue 'TBool
-BoolV Bool
-False
-  , _backupBeforeClear :: ConfigValue 'TBool
-_backupBeforeClear        = Bool -> ConfigValue 'TBool
-BoolV Bool
-False
-  , _defaultBookmarks :: ConfigValue ('TList 'TDefaultBookmark)
-_defaultBookmarks         = [ConfigValue 'TDefaultBookmark]
--> ConfigValue ('TList 'TDefaultBookmark)
-forall (a :: ConfigValueType).
-[ConfigValue a] -> ConfigValue ('TList a)
-ListOfV []
-  , _defaultCommand :: ConfigValue ('TMaybe 'TCommand)
-_defaultCommand           = Maybe (ConfigValue 'TCommand) -> ConfigValue ('TMaybe 'TCommand)
-forall (a :: ConfigValueType).
-Maybe (ConfigValue a) -> ConfigValue ('TMaybe a)
-MaybeV Maybe (ConfigValue 'TCommand)
-forall a. Maybe a
-Nothing
-  }
-
--- | Decode a 'Config' from a Text.
-decodeConfig :: T.Text -> Either T.Text Config
-decodeConfig :: Text -> Either Text Config
-decodeConfig = ([TomlDecodeError] -> Text)
--> Either [TomlDecodeError] Config -> Either Text Config
-forall (p :: * -> * -> *) a b c.
-Bifunctor p =>
-(a -> b) -> p a c -> p b c
-first [TomlDecodeError] -> Text
-Toml.prettyTomlDecodeErrors (Either [TomlDecodeError] Config -> Either Text Config)
--> (Text -> Either [TomlDecodeError] Config)
--> Text
--> Either Text Config
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. TomlCodec Config -> Text -> Either [TomlDecodeError] Config
-forall a. TomlCodec a -> Text -> Either [TomlDecodeError] a
-Toml.decodeExact TomlCodec Config
-configCodec
-
--- | Decode a 'Config' from a file.
-decodeConfigFile :: MonadIO m => FilePath -> m (Either T.Text Config)
-decodeConfigFile :: String -> m (Either Text Config)
-decodeConfigFile = (Either [TomlDecodeError] Config -> Either Text Config)
--> m (Either [TomlDecodeError] Config) -> m (Either Text Config)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-fmap (([TomlDecodeError] -> Text)
--> Either [TomlDecodeError] Config -> Either Text Config
-forall (p :: * -> * -> *) a b c.
-Bifunctor p =>
-(a -> b) -> p a c -> p b c
-first [TomlDecodeError] -> Text
-Toml.prettyTomlDecodeErrors) (m (Either [TomlDecodeError] Config) -> m (Either Text Config))
--> (String -> m (Either [TomlDecodeError] Config))
--> String
--> m (Either Text Config)
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. TomlCodec Config -> String -> m (Either [TomlDecodeError] Config)
-forall a (m :: * -> *).
-MonadIO m =>
-TomlCodec a -> String -> m (Either [TomlDecodeError] a)
-Toml.decodeFileExact TomlCodec Config
-configCodec
-
--- | Encode a 'Config' to a Text.
-encodeConfig :: Config -> T.Text
-encodeConfig :: Config -> Text
-encodeConfig = TomlCodec Config -> Config -> Text
-forall a. TomlCodec a -> a -> Text
-Toml.encode TomlCodec Config
-configCodec
-
--- | Encode a 'Config' to a file.
-encodeConfigFile :: MonadIO m => FilePath -> Config -> m ()
-encodeConfigFile :: String -> Config -> m ()
-encodeConfigFile String
-fp = m Text -> m ()
-forall (f :: * -> *) a. Functor f => f a -> f ()
-void (m Text -> m ()) -> (Config -> m Text) -> Config -> m ()
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. TomlCodec Config -> String -> Config -> m Text
-forall a (m :: * -> *).
-MonadIO m =>
-TomlCodec a -> String -> a -> m Text
-Toml.encodeToFile TomlCodec Config
-configCodec String
-fp
-
--- | Get TOML key-value pairs from a 'Config'.
-getKeyVals :: Config -> [(T.Text, AnyConfigValue)]
-getKeyVals :: Config -> [(Text, AnyConfigValue)]
-getKeyVals Config
-cfg = [
-    (Text
-"fail_on_error",         ConfigValue 'TBool -> AnyConfigValue
-forall (t :: ConfigValueType). ConfigValue t -> AnyConfigValue
-AnyConfigValue (ConfigValue 'TBool -> AnyConfigValue)
--> ConfigValue 'TBool -> AnyConfigValue
-forall a b. (a -> b) -> a -> b
-$ Config -> ConfigValue 'TBool
-_failOnError Config
-cfg)
-  , (Text
-"display_creation_time", ConfigValue 'TBool -> AnyConfigValue
-forall (t :: ConfigValueType). ConfigValue t -> AnyConfigValue
-AnyConfigValue (ConfigValue 'TBool -> AnyConfigValue)
--> ConfigValue 'TBool -> AnyConfigValue
-forall a b. (a -> b) -> a -> b
-$ Config -> ConfigValue 'TBool
-_displayCreationTime Config
-cfg)
-  , (Text
-"enable_clearing",       ConfigValue 'TBool -> AnyConfigValue
-forall (t :: ConfigValueType). ConfigValue t -> AnyConfigValue
-AnyConfigValue (ConfigValue 'TBool -> AnyConfigValue)
--> ConfigValue 'TBool -> AnyConfigValue
-forall a b. (a -> b) -> a -> b
-$ Config -> ConfigValue 'TBool
-_enableClearing Config
-cfg)
-  , (Text
-"enable_reset",          ConfigValue 'TBool -> AnyConfigValue
-forall (t :: ConfigValueType). ConfigValue t -> AnyConfigValue
-AnyConfigValue (ConfigValue 'TBool -> AnyConfigValue)
--> ConfigValue 'TBool -> AnyConfigValue
-forall a b. (a -> b) -> a -> b
-$ Config -> ConfigValue 'TBool
-_enableReset Config
-cfg)
-  , (Text
-"backup_before_clear",   ConfigValue 'TBool -> AnyConfigValue
-forall (t :: ConfigValueType). ConfigValue t -> AnyConfigValue
-AnyConfigValue (ConfigValue 'TBool -> AnyConfigValue)
--> ConfigValue 'TBool -> AnyConfigValue
-forall a b. (a -> b) -> a -> b
-$ Config -> ConfigValue 'TBool
-_backupBeforeClear Config
-cfg)
-    ] [(Text, AnyConfigValue)]
--> [(Text, AnyConfigValue)] -> [(Text, AnyConfigValue)]
-forall a. Semigroup a => a -> a -> a
-<> Maybe (Text, AnyConfigValue) -> [(Text, AnyConfigValue)]
-forall a. Maybe a -> [a]
-maybeToList ((ConfigValue 'TCommand -> (Text, AnyConfigValue))
--> Maybe (ConfigValue 'TCommand) -> Maybe (Text, AnyConfigValue)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-fmap ((Text
-"default_command", ) (AnyConfigValue -> (Text, AnyConfigValue))
--> (ConfigValue 'TCommand -> AnyConfigValue)
--> ConfigValue 'TCommand
--> (Text, AnyConfigValue)
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. ConfigValue 'TCommand -> AnyConfigValue
-forall (t :: ConfigValueType). ConfigValue t -> AnyConfigValue
-AnyConfigValue) (Maybe (ConfigValue 'TCommand) -> Maybe (Text, AnyConfigValue))
--> Maybe (ConfigValue 'TCommand) -> Maybe (Text, AnyConfigValue)
-forall a b. (a -> b) -> a -> b
-$ ConfigValue ('TMaybe 'TCommand) -> Maybe (ConfigValue 'TCommand)
-forall (t :: ConfigValueType).
-ConfigValue ('TMaybe t) -> Maybe (ConfigValue t)
-getMaybe (ConfigValue ('TMaybe 'TCommand) -> Maybe (ConfigValue 'TCommand))
--> ConfigValue ('TMaybe 'TCommand) -> Maybe (ConfigValue 'TCommand)
-forall a b. (a -> b) -> a -> b
-$ Config -> ConfigValue ('TMaybe 'TCommand)
-_defaultCommand Config
-cfg)
-      [(Text, AnyConfigValue)]
--> [(Text, AnyConfigValue)] -> [(Text, AnyConfigValue)]
-forall a. Semigroup a => a -> a -> a
-<> [(Text
-"default_bookmarks", ConfigValue ('TList 'TDefaultBookmark) -> AnyConfigValue
-forall (t :: ConfigValueType). ConfigValue t -> AnyConfigValue
-AnyConfigValue (ConfigValue ('TList 'TDefaultBookmark) -> AnyConfigValue)
--> ConfigValue ('TList 'TDefaultBookmark) -> AnyConfigValue
-forall a b. (a -> b) -> a -> b
-$ Config -> ConfigValue ('TList 'TDefaultBookmark)
-_defaultBookmarks Config
-cfg)]
-
--- | Try to set a key-value pair in the config.
-setConfig :: MonadError T.Text m => T.Text -> T.Text -> Config -> m Config
-setConfig :: Text -> Text -> Config -> m Config
-setConfig   Text
-"fail_on_error"           Text
-val Config
-cfg = (Bool -> Config -> Config) -> Config -> Bool -> Config
-forall a b c. (a -> b -> c) -> b -> a -> c
-flip (ASetter Config Config Bool Bool -> Bool -> Config -> Config
-forall s t a b. ASetter s t a b -> b -> s -> t
-set ASetter Config Config Bool Bool
-Lens' Config Bool
-failOnError) Config
-cfg
-                                                  (Bool -> Config) -> m Bool -> m Config
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Either Text Bool -> m Bool
-forall e (m :: * -> *) a. MonadError e m => Either e a -> m a
-liftEither (Text -> Either Text Bool
-forall (m :: * -> *). MonadError Text m => Text -> m Bool
-readBool Text
-val)
-setConfig   Text
-"display_creation_time"   Text
-val Config
-cfg = (Bool -> Config -> Config) -> Config -> Bool -> Config
-forall a b c. (a -> b -> c) -> b -> a -> c
-flip (ASetter Config Config Bool Bool -> Bool -> Config -> Config
-forall s t a b. ASetter s t a b -> b -> s -> t
-set ASetter Config Config Bool Bool
-Lens' Config Bool
-displayCreationTime) Config
-cfg
-                                                  (Bool -> Config) -> m Bool -> m Config
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Either Text Bool -> m Bool
-forall e (m :: * -> *) a. MonadError e m => Either e a -> m a
-liftEither (Text -> Either Text Bool
-forall (m :: * -> *). MonadError Text m => Text -> m Bool
-readBool Text
-val)
-setConfig   Text
-"enable_clearing"         Text
-val Config
-cfg = (Bool -> Config -> Config) -> Config -> Bool -> Config
-forall a b c. (a -> b -> c) -> b -> a -> c
-flip (ASetter Config Config Bool Bool -> Bool -> Config -> Config
-forall s t a b. ASetter s t a b -> b -> s -> t
-set ASetter Config Config Bool Bool
-Lens' Config Bool
-enableClearing) Config
-cfg
-                                                  (Bool -> Config) -> m Bool -> m Config
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Either Text Bool -> m Bool
-forall e (m :: * -> *) a. MonadError e m => Either e a -> m a
-liftEither (Text -> Either Text Bool
-forall (m :: * -> *). MonadError Text m => Text -> m Bool
-readBool Text
-val)
-setConfig   Text
-"enable_reset"            Text
-val Config
-cfg = (Bool -> Config -> Config) -> Config -> Bool -> Config
-forall a b c. (a -> b -> c) -> b -> a -> c
-flip (ASetter Config Config Bool Bool -> Bool -> Config -> Config
-forall s t a b. ASetter s t a b -> b -> s -> t
-set ASetter Config Config Bool Bool
-Lens' Config Bool
-enableReset) Config
-cfg
-                                                  (Bool -> Config) -> m Bool -> m Config
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Either Text Bool -> m Bool
-forall e (m :: * -> *) a. MonadError e m => Either e a -> m a
-liftEither (Text -> Either Text Bool
-forall (m :: * -> *). MonadError Text m => Text -> m Bool
-readBool Text
-val)
-setConfig   Text
-"backup_before_clear"     Text
-val Config
-cfg = (Bool -> Config -> Config) -> Config -> Bool -> Config
-forall a b c. (a -> b -> c) -> b -> a -> c
-flip (ASetter Config Config Bool Bool -> Bool -> Config -> Config
-forall s t a b. ASetter s t a b -> b -> s -> t
-set ASetter Config Config Bool Bool
-Lens' Config Bool
-backupBeforeClear) Config
-cfg
-                                                  (Bool -> Config) -> m Bool -> m Config
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Either Text Bool -> m Bool
-forall e (m :: * -> *) a. MonadError e m => Either e a -> m a
-liftEither (Text -> Either Text Bool
-forall (m :: * -> *). MonadError Text m => Text -> m Bool
-readBool Text
-val)
-setConfig Text
-key Text
-_ Config
-_ = Text -> m Config
-forall e (m :: * -> *) a. MonadError e m => e -> m a
-throwError (Text
-"Invalid key: " Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-key)
-
\ No newline at end of file diff --git a/docs/src/HoYo.Internal.Env.html b/docs/src/HoYo.Internal.Env.html deleted file mode 100644 index 5bd75a9..0000000 --- a/docs/src/HoYo.Internal.Env.html +++ /dev/null @@ -1,394 +0,0 @@ -
{-|
-Module      : HoYo.Internal.Env
-Copyright   : (c) Frederick Pringle, 2023
-License     : BSD-3-Clause
-Maintainer  : freddyjepringle@gmail.com
-
-Internals used by the HoYo.Internal module.
--}
-
-module HoYo.Internal.Env where
-
-import           Control.Monad.Except
-
-import qualified Data.Text              as T
-
-import           HoYo.Internal.Bookmark
-import           HoYo.Internal.Config
-import           HoYo.Internal.Types
-import           HoYo.Internal.Utils
-
-import           Lens.Micro.Extras
-
-import           System.Directory
-import           System.FilePath
-
--- | Write an 'Env' to file.
-writeEnv :: MonadIO m => Env -> m ()
-writeEnv :: Env -> m ()
-writeEnv Env
-env = do
-  FilePath -> Bookmarks -> m ()
-forall (m :: * -> *). MonadIO m => FilePath -> Bookmarks -> m ()
-encodeBookmarksFile (Getting FilePath Env FilePath -> Env -> FilePath
-forall a s. Getting a s a -> s -> a
-view Getting FilePath Env FilePath
-Lens' Env FilePath
-bookmarksPath Env
-env) (Getting Bookmarks Env Bookmarks -> Env -> Bookmarks
-forall a s. Getting a s a -> s -> a
-view Getting Bookmarks Env Bookmarks
-Lens' Env Bookmarks
-bookmarks Env
-env)
-  FilePath -> Config -> m ()
-forall (m :: * -> *). MonadIO m => FilePath -> Config -> m ()
-encodeConfigFile (Getting FilePath Env FilePath -> Env -> FilePath
-forall a s. Getting a s a -> s -> a
-view Getting FilePath Env FilePath
-Lens' Env FilePath
-configPath Env
-env) (Getting Config Env Config -> Env -> Config
-forall a s. Getting a s a -> s -> a
-view Getting Config Env Config
-Lens' Env Config
-config Env
-env)
-
--- | Read an 'Env' from a file.
-readEnv :: MonadIO m => FilePath -> FilePath -> m (Either T.Text Env)
-readEnv :: FilePath -> FilePath -> m (Either Text Env)
-readEnv FilePath
-bFp FilePath
-sFp = do
-  Either Text Bookmarks
-bs <- FilePath -> m (Either Text Bookmarks)
-forall (m :: * -> *).
-MonadIO m =>
-FilePath -> m (Either Text Bookmarks)
-decodeBookmarksFile FilePath
-bFp
-  Either Text Config
-se <- FilePath -> m (Either Text Config)
-forall (m :: * -> *).
-MonadIO m =>
-FilePath -> m (Either Text Config)
-decodeConfigFile FilePath
-sFp
-  case (Either Text Bookmarks
-bs, Either Text Config
-se) of
-    (Right Bookmarks
-b, Right Config
-s) -> Either Text Env -> m (Either Text Env)
-forall (m :: * -> *) a. Monad m => a -> m a
-return (Either Text Env -> m (Either Text Env))
--> Either Text Env -> m (Either Text Env)
-forall a b. (a -> b) -> a -> b
-$ Env -> Either Text Env
-forall a b. b -> Either a b
-Right (Bookmarks -> FilePath -> Config -> FilePath -> Env
-Env Bookmarks
-b FilePath
-bFp Config
-s FilePath
-sFp)
-    (Left Text
-e, Right Config
-_)  -> Either Text Env -> m (Either Text Env)
-forall (m :: * -> *) a. Monad m => a -> m a
-return (Either Text Env -> m (Either Text Env))
--> Either Text Env -> m (Either Text Env)
-forall a b. (a -> b) -> a -> b
-$ Text -> Either Text Env
-forall a b. a -> Either a b
-Left Text
-e
-    (Right Bookmarks
-_, Left Text
-e)  -> Either Text Env -> m (Either Text Env)
-forall (m :: * -> *) a. Monad m => a -> m a
-return (Either Text Env -> m (Either Text Env))
--> Either Text Env -> m (Either Text Env)
-forall a b. (a -> b) -> a -> b
-$ Text -> Either Text Env
-forall a b. a -> Either a b
-Left Text
-e
-    (Left Text
-e1, Left Text
-e2) -> Either Text Env -> m (Either Text Env)
-forall (m :: * -> *) a. Monad m => a -> m a
-return (Either Text Env -> m (Either Text Env))
--> Either Text Env -> m (Either Text Env)
-forall a b. (a -> b) -> a -> b
-$ Text -> Either Text Env
-forall a b. a -> Either a b
-Left ([Text] -> Text
-T.unlines [Text
-e1, Text
-e2])
-
--- | Given a file path, make sure that its directory exists.
-initPath :: MonadIO m => FilePath -> m ()
-initPath :: FilePath -> m ()
-initPath FilePath
-fp' = do
-  FilePath
-fp <- IO FilePath -> m FilePath
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO FilePath -> m FilePath) -> IO FilePath -> m FilePath
-forall a b. (a -> b) -> a -> b
-$ FilePath -> IO FilePath
-makeAbsolute FilePath
-fp'
-  let dir :: FilePath
-dir = FilePath -> FilePath
-takeDirectory FilePath
-fp
-  IO () -> m ()
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO () -> m ()) -> IO () -> m ()
-forall a b. (a -> b) -> a -> b
-$ Bool -> FilePath -> IO ()
-createDirectoryIfMissing Bool
-True FilePath
-dir
-
--- | Given a filepath for the bookmarks file and a filepath for the config file,
--- initialize the respective TOMLs at those locations.
-initEnv :: MonadIO m => FilePath -> FilePath -> m ()
-initEnv :: FilePath -> FilePath -> m ()
-initEnv FilePath
-bFp FilePath
-sFp = do
-  FilePath -> m ()
-forall (m :: * -> *). MonadIO m => FilePath -> m ()
-initPath FilePath
-sFp
-  FilePath -> m ()
-forall (m :: * -> *). MonadIO m => FilePath -> m ()
-initPath FilePath
-bFp
-  Bookmarks
-bms <- [DefaultBookmark] -> m Bookmarks
-forall (m :: * -> *). MonadIO m => [DefaultBookmark] -> m Bookmarks
-bookmarksFromDefault ([DefaultBookmark] -> m Bookmarks)
--> [DefaultBookmark] -> m Bookmarks
-forall a b. (a -> b) -> a -> b
-$ Getting [DefaultBookmark] Config [DefaultBookmark]
--> Config -> [DefaultBookmark]
-forall a s. Getting a s a -> s -> a
-view Getting [DefaultBookmark] Config [DefaultBookmark]
-Lens' Config [DefaultBookmark]
-defaultBookmarks Config
-defaultConfig
-  let env :: Env
-env = Bookmarks -> FilePath -> Config -> FilePath -> Env
-Env Bookmarks
-bms FilePath
-bFp Config
-defaultConfig FilePath
-sFp
-  Env -> m ()
-forall (m :: * -> *). MonadIO m => Env -> m ()
-writeEnv Env
-env
-
--- | If the bookmarks path doesn't exist, try to create it.
---
--- Returns the newly created 'Bookmarks' object, or the result of parsing
--- the file if it already existed.
-initBookmarksIfNotExists :: (MonadIO m, MonadError T.Text m) => Config -> FilePath -> m Bookmarks
-initBookmarksIfNotExists :: Config -> FilePath -> m Bookmarks
-initBookmarksIfNotExists Config
-cfg FilePath
-fp' = do
-  FilePath
-fp <- IO FilePath -> m FilePath
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO FilePath -> m FilePath) -> IO FilePath -> m FilePath
-forall a b. (a -> b) -> a -> b
-$ FilePath -> IO FilePath
-makeAbsolute FilePath
-fp'
-  Bool
-ex <- IO Bool -> m Bool
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
-forall a b. (a -> b) -> a -> b
-$ FilePath -> IO Bool
-doesFileExist FilePath
-fp
-  Bool -> m () -> m ()
-forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
-unless Bool
-ex (m () -> m ()) -> m () -> m ()
-forall a b. (a -> b) -> a -> b
-$ do
-    FilePath -> m ()
-forall (m :: * -> *). MonadIO m => FilePath -> m ()
-initPath FilePath
-fp
-    Bookmarks
-bms <- [DefaultBookmark] -> m Bookmarks
-forall (m :: * -> *). MonadIO m => [DefaultBookmark] -> m Bookmarks
-bookmarksFromDefault ([DefaultBookmark] -> m Bookmarks)
--> [DefaultBookmark] -> m Bookmarks
-forall a b. (a -> b) -> a -> b
-$ Getting [DefaultBookmark] Config [DefaultBookmark]
--> Config -> [DefaultBookmark]
-forall a s. Getting a s a -> s -> a
-view Getting [DefaultBookmark] Config [DefaultBookmark]
-Lens' Config [DefaultBookmark]
-defaultBookmarks Config
-cfg
-    FilePath -> Bookmarks -> m ()
-forall (m :: * -> *). MonadIO m => FilePath -> Bookmarks -> m ()
-encodeBookmarksFile FilePath
-fp Bookmarks
-bms
-  FilePath -> m (Either Text Bookmarks)
-forall (m :: * -> *).
-MonadIO m =>
-FilePath -> m (Either Text Bookmarks)
-decodeBookmarksFile FilePath
-fp m (Either Text Bookmarks)
--> (Either Text Bookmarks -> m Bookmarks) -> m Bookmarks
-forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
->>= Either Text Bookmarks -> m Bookmarks
-forall e (m :: * -> *) a. MonadError e m => Either e a -> m a
-liftEither
-
--- | If the config path doesn't exist, try to create it.
---
--- Returns the newly created 'Config' object, or the result of parsing
--- the file if it already existed.
-initConfigIfNotExists :: (MonadIO m, MonadError T.Text m) => FilePath -> m Config
-initConfigIfNotExists :: FilePath -> m Config
-initConfigIfNotExists FilePath
-fp' = do
-  FilePath
-fp <- IO FilePath -> m FilePath
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO FilePath -> m FilePath) -> IO FilePath -> m FilePath
-forall a b. (a -> b) -> a -> b
-$ FilePath -> IO FilePath
-makeAbsolute FilePath
-fp'
-  Bool
-exists <- IO Bool -> m Bool
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
-forall a b. (a -> b) -> a -> b
-$ FilePath -> IO Bool
-doesFileExist FilePath
-fp
-  Bool -> m () -> m ()
-forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
-unless Bool
-exists (m () -> m ()) -> m () -> m ()
-forall a b. (a -> b) -> a -> b
-$ do
-    FilePath -> m ()
-forall (m :: * -> *). MonadIO m => FilePath -> m ()
-initPath FilePath
-fp
-    FilePath -> Config -> m ()
-forall (m :: * -> *). MonadIO m => FilePath -> Config -> m ()
-encodeConfigFile FilePath
-fp Config
-defaultConfig
-  FilePath -> m (Either Text Config)
-forall (m :: * -> *).
-MonadIO m =>
-FilePath -> m (Either Text Config)
-decodeConfigFile FilePath
-fp m (Either Text Config)
--> (Either Text Config -> m Config) -> m Config
-forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
->>= Either Text Config -> m Config
-forall e (m :: * -> *) a. MonadError e m => Either e a -> m a
-liftEither
-
--- | If the environment files have not been created yet, do so.
---
--- Return the 'Env' object.
-initEnvIfNotExists :: (MonadIO m, MonadError T.Text m) => FilePath -> FilePath -> m Env
-initEnvIfNotExists :: FilePath -> FilePath -> m Env
-initEnvIfNotExists FilePath
-bFp FilePath
-sFp = do
-  Config
-cfg <- FilePath -> m Config
-forall (m :: * -> *).
-(MonadIO m, MonadError Text m) =>
-FilePath -> m Config
-initConfigIfNotExists FilePath
-sFp
-  Bookmarks
-bms <- Config -> FilePath -> m Bookmarks
-forall (m :: * -> *).
-(MonadIO m, MonadError Text m) =>
-Config -> FilePath -> m Bookmarks
-initBookmarksIfNotExists Config
-cfg FilePath
-bFp
-  Env -> m Env
-forall (m :: * -> *) a. Monad m => a -> m a
-return (Env -> m Env) -> Env -> m Env
-forall a b. (a -> b) -> a -> b
-$ Bookmarks -> FilePath -> Config -> FilePath -> Env
-Env Bookmarks
-bms FilePath
-bFp Config
-cfg FilePath
-sFp
-
--- | Retrieve an 'Env' from given bookmark- and config- file locations.
-getEnv :: MonadIO m => FilePath -> FilePath -> m (Either T.Text Env)
-getEnv :: FilePath -> FilePath -> m (Either Text Env)
-getEnv FilePath
-bFp' FilePath
-sFp' = do
-  FilePath
-sFp <- IO FilePath -> m FilePath
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (FilePath -> IO FilePath
-makeAbsolute FilePath
-sFp')
-  FilePath
-bFp <- IO FilePath -> m FilePath
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (FilePath -> IO FilePath
-makeAbsolute FilePath
-bFp')
-  ExceptT Text m Env -> m (Either Text Env)
-forall e (m :: * -> *) a. ExceptT e m a -> m (Either e a)
-runExceptT (ExceptT Text m Env -> m (Either Text Env))
--> ExceptT Text m Env -> m (Either Text Env)
-forall a b. (a -> b) -> a -> b
-$ FilePath -> FilePath -> ExceptT Text m Env
-forall (m :: * -> *).
-(MonadIO m, MonadError Text m) =>
-FilePath -> FilePath -> m Env
-initEnvIfNotExists FilePath
-bFp FilePath
-sFp
-
--- | The default path for the hoyo config. Usually $HOME\/.config\/hoyo\/config.toml
-defaultConfigPath :: IO FilePath
-defaultConfigPath :: IO FilePath
-defaultConfigPath = XdgDirectory -> FilePath -> IO FilePath
-getXdgDirectory XdgDirectory
-XdgConfig FilePath
-"hoyo/config.toml"
-
--- |The default path for hoyo bookmarks. Usually $HOME\/.local\/share\/hoyo\/config.toml
-defaultBookmarksPath :: IO FilePath
-defaultBookmarksPath :: IO FilePath
-defaultBookmarksPath = XdgDirectory -> FilePath -> IO FilePath
-getXdgDirectory XdgDirectory
-XdgData FilePath
-"hoyo/bookmarks.toml"
-
\ No newline at end of file diff --git a/docs/src/HoYo.Internal.Parse.html b/docs/src/HoYo.Internal.Parse.html deleted file mode 100644 index 65e7266..0000000 --- a/docs/src/HoYo.Internal.Parse.html +++ /dev/null @@ -1,1356 +0,0 @@ -
{-|
-Module      : HoYo.Internal.Parse
-Copyright   : (c) Frederick Pringle, 2023
-License     : BSD-3-Clause
-Maintainer  : freddyjepringle@gmail.com
-
-Parse CLI arguments.
--}
-
-module HoYo.Internal.Parse where
-
-import qualified Data.Text                       as T
-
-import           HoYo.CLI.Complete
-import           HoYo.Internal.Command
-import           HoYo.Internal.Types
-import           HoYo.Internal.Version
-
-import           Options.Applicative
-import           Options.Applicative.Help.Chunk
-import           Options.Applicative.Help.Pretty
-
-import           Text.Read
-
--- | Parse global options: options that can be set on the command line
--- no matter what sub-command is being run.
---
--- For a complete list of the global options, see 'GlobalOptions' or
--- run @hoyo --help@.
-globalOptions :: Parser GlobalOptions
-globalOptions :: Parser GlobalOptions
-globalOptions = Maybe FilePath
--> Maybe FilePath -> OverrideOptions -> GlobalOptions
-GlobalOptions
-                  (Maybe FilePath
- -> Maybe FilePath -> OverrideOptions -> GlobalOptions)
--> Parser (Maybe FilePath)
--> Parser (Maybe FilePath -> OverrideOptions -> GlobalOptions)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Parser FilePath -> Parser (Maybe FilePath)
-forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
-optional (Mod OptionFields FilePath -> Parser FilePath
-forall s. IsString s => Mod OptionFields s -> Parser s
-strOption (FilePath -> Mod OptionFields FilePath
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"config-file"
-                                Mod OptionFields FilePath
--> Mod OptionFields FilePath -> Mod OptionFields FilePath
-forall a. Semigroup a => a -> a -> a
-<> Char -> Mod OptionFields FilePath
-forall (f :: * -> *) a. HasName f => Char -> Mod f a
-short Char
-'C'
-                                Mod OptionFields FilePath
--> Mod OptionFields FilePath -> Mod OptionFields FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod OptionFields FilePath
-forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
-metavar FilePath
-"<file>"
-                                Mod OptionFields FilePath
--> Mod OptionFields FilePath -> Mod OptionFields FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod OptionFields FilePath
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Override the default config file"
-                                Mod OptionFields FilePath
--> Mod OptionFields FilePath -> Mod OptionFields FilePath
-forall a. Semigroup a => a -> a -> a
-<> Mod OptionFields FilePath
-forall a (f :: * -> *). Show a => Mod f a
-showDefault
-                                Mod OptionFields FilePath
--> Mod OptionFields FilePath -> Mod OptionFields FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod OptionFields FilePath
-forall (f :: * -> *) a. HasCompleter f => FilePath -> Mod f a
-action FilePath
-"file"))
-                  Parser (Maybe FilePath -> OverrideOptions -> GlobalOptions)
--> Parser (Maybe FilePath)
--> Parser (OverrideOptions -> GlobalOptions)
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Parser FilePath -> Parser (Maybe FilePath)
-forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
-optional (Mod OptionFields FilePath -> Parser FilePath
-forall s. IsString s => Mod OptionFields s -> Parser s
-strOption (FilePath -> Mod OptionFields FilePath
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"bookmarks-file"
-                                Mod OptionFields FilePath
--> Mod OptionFields FilePath -> Mod OptionFields FilePath
-forall a. Semigroup a => a -> a -> a
-<> Char -> Mod OptionFields FilePath
-forall (f :: * -> *) a. HasName f => Char -> Mod f a
-short Char
-'B'
-                                Mod OptionFields FilePath
--> Mod OptionFields FilePath -> Mod OptionFields FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod OptionFields FilePath
-forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
-metavar FilePath
-"<file>"
-                                Mod OptionFields FilePath
--> Mod OptionFields FilePath -> Mod OptionFields FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod OptionFields FilePath
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Override the default bookmarks file"
-                                Mod OptionFields FilePath
--> Mod OptionFields FilePath -> Mod OptionFields FilePath
-forall a. Semigroup a => a -> a -> a
-<> Mod OptionFields FilePath
-forall a (f :: * -> *). Show a => Mod f a
-showDefault
-                                Mod OptionFields FilePath
--> Mod OptionFields FilePath -> Mod OptionFields FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod OptionFields FilePath
-forall (f :: * -> *) a. HasCompleter f => FilePath -> Mod f a
-action FilePath
-"file"))
-                  Parser (OverrideOptions -> GlobalOptions)
--> Parser OverrideOptions -> Parser GlobalOptions
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Parser OverrideOptions
-overrideOptions
-
--- | Parse override options: options that override config settings.
--- This can be useful when you want to temporarily enable functionality
--- for one CLI run, but don't want to change it in the config file.
-overrideOptions :: Parser OverrideOptions
-overrideOptions :: Parser OverrideOptions
-overrideOptions = MaybeOverride
--> MaybeOverride
--> MaybeOverride
--> MaybeOverride
--> MaybeOverride
--> OverrideOptions
-OverrideOptions
-                    (MaybeOverride
- -> MaybeOverride
- -> MaybeOverride
- -> MaybeOverride
- -> MaybeOverride
- -> OverrideOptions)
--> Parser MaybeOverride
--> Parser
-     (MaybeOverride
-      -> MaybeOverride
-      -> MaybeOverride
-      -> MaybeOverride
-      -> OverrideOptions)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Parser MaybeOverride
-parseOverrideFailOnError
-                    Parser
-  (MaybeOverride
-   -> MaybeOverride
-   -> MaybeOverride
-   -> MaybeOverride
-   -> OverrideOptions)
--> Parser MaybeOverride
--> Parser
-     (MaybeOverride
-      -> MaybeOverride -> MaybeOverride -> OverrideOptions)
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Parser MaybeOverride
-parseOverrideDisplayCreationTime
-                    Parser
-  (MaybeOverride
-   -> MaybeOverride -> MaybeOverride -> OverrideOptions)
--> Parser MaybeOverride
--> Parser (MaybeOverride -> MaybeOverride -> OverrideOptions)
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Parser MaybeOverride
-parseOverrideEnableClearing
-                    Parser (MaybeOverride -> MaybeOverride -> OverrideOptions)
--> Parser MaybeOverride
--> Parser (MaybeOverride -> OverrideOptions)
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Parser MaybeOverride
-parseOverrideEnableReset
-                    Parser (MaybeOverride -> OverrideOptions)
--> Parser MaybeOverride -> Parser OverrideOptions
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Parser MaybeOverride
-parseOverrideBackupBeforeClear
-
--- | Parse a single override option as a pair of switches.
--- For example 'parseOverrideFailOnError' is defined as
---
--- @
--- parseOverrideFailOnError :: 'Parser' 'MaybeOverride'
--- parseOverrideFailOnError = parseOverride
---                               (long "fail" <> help "Fail on error")
---                               (long "nofail" <> help "Disable fail on error")
--- @
---
--- and results in the pair of switches:
---
--- @
---  --fail                   Fail on error
---  --nofail                 Disable fail on error
--- @
-parseOverride :: Mod FlagFields Bool -> Mod FlagFields Bool -> Parser MaybeOverride
-parseOverride :: Mod FlagFields Bool -> Mod FlagFields Bool -> Parser MaybeOverride
-parseOverride Mod FlagFields Bool
-posMod Mod FlagFields Bool
-negMod = Bool -> Bool -> MaybeOverride
-combOverride
-                                (Bool -> Bool -> MaybeOverride)
--> Parser Bool -> Parser (Bool -> MaybeOverride)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Mod FlagFields Bool -> Parser Bool
-switch Mod FlagFields Bool
-posMod
-                                Parser (Bool -> MaybeOverride)
--> Parser Bool -> Parser MaybeOverride
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Mod FlagFields Bool -> Parser Bool
-switch Mod FlagFields Bool
-negMod
-
--- | Parse a 'MaybeOverride' corresponding to the "fail_on_error" config option.
-parseOverrideFailOnError :: Parser MaybeOverride
-parseOverrideFailOnError :: Parser MaybeOverride
-parseOverrideFailOnError = Mod FlagFields Bool -> Mod FlagFields Bool -> Parser MaybeOverride
-parseOverride
-                              (FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"fail" Mod FlagFields Bool -> Mod FlagFields Bool -> Mod FlagFields Bool
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Fail on error")
-                              (FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"nofail" Mod FlagFields Bool -> Mod FlagFields Bool -> Mod FlagFields Bool
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Disable fail on error")
-
--- | Parse a 'MaybeOverride' corresponding to the "display_creation_time" config option.
-parseOverrideDisplayCreationTime :: Parser MaybeOverride
-parseOverrideDisplayCreationTime :: Parser MaybeOverride
-parseOverrideDisplayCreationTime = Mod FlagFields Bool -> Mod FlagFields Bool -> Parser MaybeOverride
-parseOverride
-                                    (FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"time" Mod FlagFields Bool -> Mod FlagFields Bool -> Mod FlagFields Bool
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Display bookmark creation times")
-                                    (FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"notime" Mod FlagFields Bool -> Mod FlagFields Bool -> Mod FlagFields Bool
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Hide bookmark creation times")
-
--- | Parse a 'MaybeOverride' corresponding to the "enable_clear" config option.
-parseOverrideEnableClearing :: Parser MaybeOverride
-parseOverrideEnableClearing :: Parser MaybeOverride
-parseOverrideEnableClearing = Mod FlagFields Bool -> Mod FlagFields Bool -> Parser MaybeOverride
-parseOverride
-                                (FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"enable-clear" Mod FlagFields Bool -> Mod FlagFields Bool -> Mod FlagFields Bool
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Enable the 'clear' command")
-                                (FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"disable-clear" Mod FlagFields Bool -> Mod FlagFields Bool -> Mod FlagFields Bool
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Disable the 'clear' command")
-
--- | Parse a 'MaybeOverride' corresponding to the "enable_reset" config option.
-parseOverrideEnableReset :: Parser MaybeOverride
-parseOverrideEnableReset :: Parser MaybeOverride
-parseOverrideEnableReset = Mod FlagFields Bool -> Mod FlagFields Bool -> Parser MaybeOverride
-parseOverride
-                              (FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"enable-reset" Mod FlagFields Bool -> Mod FlagFields Bool -> Mod FlagFields Bool
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Enable the 'config reset' command")
-                              (FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"disable-reset" Mod FlagFields Bool -> Mod FlagFields Bool -> Mod FlagFields Bool
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Disable the 'config reset' command")
-
--- | Parse a 'MaybeOverride' corresponding to the "backup_before_clear" config option.
-parseOverrideBackupBeforeClear :: Parser MaybeOverride
-parseOverrideBackupBeforeClear :: Parser MaybeOverride
-parseOverrideBackupBeforeClear = Mod FlagFields Bool -> Mod FlagFields Bool -> Parser MaybeOverride
-parseOverride
-                              (FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"backup-before-clear" Mod FlagFields Bool -> Mod FlagFields Bool -> Mod FlagFields Bool
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Backup the bookmarks file before running `hoyo clear`")
-                              (FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"no-backup-before-clear" Mod FlagFields Bool -> Mod FlagFields Bool -> Mod FlagFields Bool
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Don't backup the bookmarks file before running `hoyo clear`")
-
--- | Parse options for the @hoyo add@ command.
-addCommand :: Parser Command
-addCommand :: Parser Command
-addCommand = AddOptions -> Command
-Add (AddOptions -> Command) -> Parser AddOptions -> Parser Command
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> (
-              FilePath -> Maybe Text -> AddOptions
-AddOptions
-                (FilePath -> Maybe Text -> AddOptions)
--> Parser FilePath -> Parser (Maybe Text -> AddOptions)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Mod ArgumentFields FilePath -> Parser FilePath
-forall s. IsString s => Mod ArgumentFields s -> Parser s
-strArgument (FilePath -> Mod ArgumentFields FilePath
-forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
-metavar FilePath
-"<dir>" Mod ArgumentFields FilePath
--> Mod ArgumentFields FilePath -> Mod ArgumentFields FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod ArgumentFields FilePath
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Directory to bookmark" Mod ArgumentFields FilePath
--> Mod ArgumentFields FilePath -> Mod ArgumentFields FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod ArgumentFields FilePath
-forall (f :: * -> *) a. HasCompleter f => FilePath -> Mod f a
-action FilePath
-"directory")
-                Parser (Maybe Text -> AddOptions)
--> Parser (Maybe Text) -> Parser AddOptions
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Parser Text -> Parser (Maybe Text)
-forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
-optional (Mod ArgumentFields Text -> Parser Text
-forall s. IsString s => Mod ArgumentFields s -> Parser s
-strArgument (FilePath -> Mod ArgumentFields Text
-forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
-metavar FilePath
-"<name>" Mod ArgumentFields Text
--> Mod ArgumentFields Text -> Mod ArgumentFields Text
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod ArgumentFields Text
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Optionally give a name to your bookmark"))
-              )
-
--- | Parse a 'BookmarkSearchTerm'. First tries to interpret the search term as a number
--- corresponding to a bookmark index; if that fails, treat the term as a name.
-bookmarkSearchTerm :: ReadM BookmarkSearchTerm
-bookmarkSearchTerm :: ReadM BookmarkSearchTerm
-bookmarkSearchTerm = (FilePath -> Either FilePath BookmarkSearchTerm)
--> ReadM BookmarkSearchTerm
-forall a. (FilePath -> Either FilePath a) -> ReadM a
-eitherReader ((FilePath -> Either FilePath BookmarkSearchTerm)
- -> ReadM BookmarkSearchTerm)
--> (FilePath -> Either FilePath BookmarkSearchTerm)
--> ReadM BookmarkSearchTerm
-forall a b. (a -> b) -> a -> b
-$ \FilePath
-s ->
-  Int -> BookmarkSearchTerm
-SearchIndex (Int -> BookmarkSearchTerm)
--> Either FilePath Int -> Either FilePath BookmarkSearchTerm
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> FilePath -> Either FilePath Int
-forall a. Read a => FilePath -> Either FilePath a
-readEither FilePath
-s
-  Either FilePath BookmarkSearchTerm
--> Either FilePath BookmarkSearchTerm
--> Either FilePath BookmarkSearchTerm
-forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
-<|> BookmarkSearchTerm -> Either FilePath BookmarkSearchTerm
-forall a b. b -> Either a b
-Right (Text -> BookmarkSearchTerm
-SearchName (FilePath -> Text
-T.pack FilePath
-s))
-
--- | Parse options for the @hoyo move@ command.
-moveCommand :: Parser Command
-moveCommand :: Parser Command
-moveCommand = MoveOptions -> Command
-Move (MoveOptions -> Command)
--> (BookmarkSearchTerm -> MoveOptions)
--> BookmarkSearchTerm
--> Command
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. BookmarkSearchTerm -> MoveOptions
-MoveOptions
-                (BookmarkSearchTerm -> Command)
--> Parser BookmarkSearchTerm -> Parser Command
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> ReadM BookmarkSearchTerm
--> Mod ArgumentFields BookmarkSearchTerm
--> Parser BookmarkSearchTerm
-forall a. ReadM a -> Mod ArgumentFields a -> Parser a
-argument ReadM BookmarkSearchTerm
-bookmarkSearchTerm (
-                      FilePath -> Mod ArgumentFields BookmarkSearchTerm
-forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
-metavar FilePath
-"<bookmark>"
-                      Mod ArgumentFields BookmarkSearchTerm
--> Mod ArgumentFields BookmarkSearchTerm
--> Mod ArgumentFields BookmarkSearchTerm
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod ArgumentFields BookmarkSearchTerm
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Index or name of the bookmark to move to"
-                      Mod ArgumentFields BookmarkSearchTerm
--> Mod ArgumentFields BookmarkSearchTerm
--> Mod ArgumentFields BookmarkSearchTerm
-forall a. Semigroup a => a -> a -> a
-<> Completer -> Mod ArgumentFields BookmarkSearchTerm
-forall (f :: * -> *) a. HasCompleter f => Completer -> Mod f a
-completer Completer
-bookmarkCompleter
-                      )
-
--- | Parse options for the @hoyo list@ command.
-listCommand :: Parser Command
-listCommand :: Parser Command
-listCommand = ListOptions -> Command
-List (ListOptions -> Command) -> Parser ListOptions -> Parser Command
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> (
-                  Maybe Text -> Maybe Text -> ListOptions
-ListOptions
-                    (Maybe Text -> Maybe Text -> ListOptions)
--> Parser (Maybe Text) -> Parser (Maybe Text -> ListOptions)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Parser Text -> Parser (Maybe Text)
-forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
-optional (Mod OptionFields Text -> Parser Text
-forall s. IsString s => Mod OptionFields s -> Parser s
-strOption (
-                          FilePath -> Mod OptionFields Text
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"name"
-                          Mod OptionFields Text
--> Mod OptionFields Text -> Mod OptionFields Text
-forall a. Semigroup a => a -> a -> a
-<> Char -> Mod OptionFields Text
-forall (f :: * -> *) a. HasName f => Char -> Mod f a
-short Char
-'n'
-                          Mod OptionFields Text
--> Mod OptionFields Text -> Mod OptionFields Text
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod OptionFields Text
-forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
-metavar FilePath
-"<name>"
-                          Mod OptionFields Text
--> Mod OptionFields Text -> Mod OptionFields Text
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod OptionFields Text
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Search bookmarks by name"
-                        ))
-                    Parser (Maybe Text -> ListOptions)
--> Parser (Maybe Text) -> Parser ListOptions
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Parser Text -> Parser (Maybe Text)
-forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
-optional (Mod OptionFields Text -> Parser Text
-forall s. IsString s => Mod OptionFields s -> Parser s
-strOption (
-                          FilePath -> Mod OptionFields Text
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"dir"
-                          Mod OptionFields Text
--> Mod OptionFields Text -> Mod OptionFields Text
-forall a. Semigroup a => a -> a -> a
-<> Char -> Mod OptionFields Text
-forall (f :: * -> *) a. HasName f => Char -> Mod f a
-short Char
-'d'
-                          Mod OptionFields Text
--> Mod OptionFields Text -> Mod OptionFields Text
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod OptionFields Text
-forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
-metavar FilePath
-"<directory>"
-                          Mod OptionFields Text
--> Mod OptionFields Text -> Mod OptionFields Text
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod OptionFields Text
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Search bookmarks by directory"
-                        ))
-                  )
-
--- | Parse options for the @hoyo clear@ command.
-clearCommand :: Parser Command
-clearCommand :: Parser Command
-clearCommand = Command -> Parser Command
-forall (f :: * -> *) a. Applicative f => a -> f a
-pure (ClearOptions -> Command
-Clear ClearOptions
-ClearOptions)
-
--- | Parse options for the @hoyo delete@ command.
-deleteCommand :: Parser Command
-deleteCommand :: Parser Command
-deleteCommand =  DeleteOptions -> Command
-Delete (DeleteOptions -> Command)
--> (BookmarkSearchTerm -> DeleteOptions)
--> BookmarkSearchTerm
--> Command
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. BookmarkSearchTerm -> DeleteOptions
-DeleteOptions
-                    (BookmarkSearchTerm -> Command)
--> Parser BookmarkSearchTerm -> Parser Command
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> ReadM BookmarkSearchTerm
--> Mod ArgumentFields BookmarkSearchTerm
--> Parser BookmarkSearchTerm
-forall a. ReadM a -> Mod ArgumentFields a -> Parser a
-argument ReadM BookmarkSearchTerm
-bookmarkSearchTerm (
-                          FilePath -> Mod ArgumentFields BookmarkSearchTerm
-forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
-metavar FilePath
-"<bookmark>"
-                          Mod ArgumentFields BookmarkSearchTerm
--> Mod ArgumentFields BookmarkSearchTerm
--> Mod ArgumentFields BookmarkSearchTerm
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod ArgumentFields BookmarkSearchTerm
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Index or name of the bookmark to delete"
-                          Mod ArgumentFields BookmarkSearchTerm
--> Mod ArgumentFields BookmarkSearchTerm
--> Mod ArgumentFields BookmarkSearchTerm
-forall a. Semigroup a => a -> a -> a
-<> Completer -> Mod ArgumentFields BookmarkSearchTerm
-forall (f :: * -> *) a. HasCompleter f => Completer -> Mod f a
-completer Completer
-bookmarkCompleter
-                        )
-
--- | Parse options for the @hoyo refresh@ command.
-refreshCommand :: Parser Command
-refreshCommand :: Parser Command
-refreshCommand = Command -> Parser Command
-forall (f :: * -> *) a. Applicative f => a -> f a
-pure (RefreshOptions -> Command
-Refresh RefreshOptions
-RefreshOptions)
-
--- | Parse options for the @hoyo config@ command.
-configCommand :: Parser Command
-configCommand :: Parser Command
-configCommand = ConfigCommand -> Command
-ConfigCmd (ConfigCommand -> Command)
--> Parser ConfigCommand -> Parser Command
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Mod CommandFields ConfigCommand -> Parser ConfigCommand
-forall a. Mod CommandFields a -> Parser a
-hsubparser (
-  FilePath
--> ParserInfo ConfigCommand -> Mod CommandFields ConfigCommand
-forall a. FilePath -> ParserInfo a -> Mod CommandFields a
-command FilePath
-"print" (Parser ConfigCommand
--> InfoMod ConfigCommand -> ParserInfo ConfigCommand
-forall a. Parser a -> InfoMod a -> ParserInfo a
-info Parser ConfigCommand
-configPrintCommand (FilePath -> InfoMod ConfigCommand
-forall a. FilePath -> InfoMod a
-progDesc FilePath
-"Print hoyo config"))
-  Mod CommandFields ConfigCommand
--> Mod CommandFields ConfigCommand
--> Mod CommandFields ConfigCommand
-forall a. Semigroup a => a -> a -> a
-<> FilePath
--> ParserInfo ConfigCommand -> Mod CommandFields ConfigCommand
-forall a. FilePath -> ParserInfo a -> Mod CommandFields a
-command FilePath
-"reset" (Parser ConfigCommand
--> InfoMod ConfigCommand -> ParserInfo ConfigCommand
-forall a. Parser a -> InfoMod a -> ParserInfo a
-info Parser ConfigCommand
-configResetCommand (FilePath -> InfoMod ConfigCommand
-forall a. FilePath -> InfoMod a
-progDesc FilePath
-"Reset hoyo config"))
-  Mod CommandFields ConfigCommand
--> Mod CommandFields ConfigCommand
--> Mod CommandFields ConfigCommand
-forall a. Semigroup a => a -> a -> a
-<> FilePath
--> ParserInfo ConfigCommand -> Mod CommandFields ConfigCommand
-forall a. FilePath -> ParserInfo a -> Mod CommandFields a
-command FilePath
-"set" (Parser ConfigCommand
--> InfoMod ConfigCommand -> ParserInfo ConfigCommand
-forall a. Parser a -> InfoMod a -> ParserInfo a
-info Parser ConfigCommand
-configSetCommand (FilePath -> InfoMod ConfigCommand
-forall a. FilePath -> InfoMod a
-progDesc FilePath
-"Modify hoyo config"))
-  Mod CommandFields ConfigCommand
--> Mod CommandFields ConfigCommand
--> Mod CommandFields ConfigCommand
-forall a. Semigroup a => a -> a -> a
-<> FilePath
--> ParserInfo ConfigCommand -> Mod CommandFields ConfigCommand
-forall a. FilePath -> ParserInfo a -> Mod CommandFields a
-command FilePath
-"add-default" (Parser ConfigCommand
--> InfoMod ConfigCommand -> ParserInfo ConfigCommand
-forall a. Parser a -> InfoMod a -> ParserInfo a
-info Parser ConfigCommand
-configAddDefaultCommand (FilePath -> InfoMod ConfigCommand
-forall a. FilePath -> InfoMod a
-progDesc FilePath
-"Add a default bookmark"))
-  )
-
--- | Parse options for the @hoyo config print@ sub-command.
-configPrintCommand :: Parser ConfigCommand
-configPrintCommand :: Parser ConfigCommand
-configPrintCommand = ConfigCommand -> Parser ConfigCommand
-forall (f :: * -> *) a. Applicative f => a -> f a
-pure (ConfigPrintOptions -> ConfigCommand
-Print ConfigPrintOptions
-ConfigPrintOptions)
-
--- | Parse options for the @hoyo config reset@ sub-command.
-configResetCommand :: Parser ConfigCommand
-configResetCommand :: Parser ConfigCommand
-configResetCommand = ConfigCommand -> Parser ConfigCommand
-forall (f :: * -> *) a. Applicative f => a -> f a
-pure (ConfigResetOptions -> ConfigCommand
-Reset ConfigResetOptions
-ConfigResetOptions)
-
--- | Parse options for the @hoyo config set@ sub-command.
-configSetCommand :: Parser ConfigCommand
-configSetCommand :: Parser ConfigCommand
-configSetCommand = ConfigSetOptions -> ConfigCommand
-Set (ConfigSetOptions -> ConfigCommand)
--> Parser ConfigSetOptions -> Parser ConfigCommand
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> (
-                    Text -> Text -> ConfigSetOptions
-ConfigSetOptions
-                      (Text -> Text -> ConfigSetOptions)
--> Parser Text -> Parser (Text -> ConfigSetOptions)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Mod ArgumentFields Text -> Parser Text
-forall s. IsString s => Mod ArgumentFields s -> Parser s
-strArgument (
-                            FilePath -> Mod ArgumentFields Text
-forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
-metavar FilePath
-"<key>"
-                            Mod ArgumentFields Text
--> Mod ArgumentFields Text -> Mod ArgumentFields Text
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod ArgumentFields Text
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Option to modify"
-                            Mod ArgumentFields Text
--> Mod ArgumentFields Text -> Mod ArgumentFields Text
-forall a. Semigroup a => a -> a -> a
-<> Completer -> Mod ArgumentFields Text
-forall (f :: * -> *) a. HasCompleter f => Completer -> Mod f a
-completer Completer
-configKeyCompleter
-                          )
-                      Parser (Text -> ConfigSetOptions)
--> Parser Text -> Parser ConfigSetOptions
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Mod ArgumentFields Text -> Parser Text
-forall s. IsString s => Mod ArgumentFields s -> Parser s
-strArgument (
-                            FilePath -> Mod ArgumentFields Text
-forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
-metavar FilePath
-"<value>"
-                            Mod ArgumentFields Text
--> Mod ArgumentFields Text -> Mod ArgumentFields Text
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod ArgumentFields Text
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Option value"
-                            Mod ArgumentFields Text
--> Mod ArgumentFields Text -> Mod ArgumentFields Text
-forall a. Semigroup a => a -> a -> a
-<> Completer -> Mod ArgumentFields Text
-forall (f :: * -> *) a. HasCompleter f => Completer -> Mod f a
-completer Completer
-configValueCompleter
-                          )
-                    )
-
--- | Parse options for the @hoyo config add-default@ sub-command.
-configAddDefaultCommand :: Parser ConfigCommand
-configAddDefaultCommand :: Parser ConfigCommand
-configAddDefaultCommand = ConfigAddDefaultOptions -> ConfigCommand
-AddDefaultBookmark (ConfigAddDefaultOptions -> ConfigCommand)
--> Parser ConfigAddDefaultOptions -> Parser ConfigCommand
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> (
-                            FilePath -> Maybe Text -> ConfigAddDefaultOptions
-ConfigAddDefaultOptions
-                              (FilePath -> Maybe Text -> ConfigAddDefaultOptions)
--> Parser FilePath
--> Parser (Maybe Text -> ConfigAddDefaultOptions)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Mod ArgumentFields FilePath -> Parser FilePath
-forall s. IsString s => Mod ArgumentFields s -> Parser s
-strArgument (
-                                    FilePath -> Mod ArgumentFields FilePath
-forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
-metavar FilePath
-"<dir>"
-                                    Mod ArgumentFields FilePath
--> Mod ArgumentFields FilePath -> Mod ArgumentFields FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod ArgumentFields FilePath
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Directory to bookmark"
-                                    Mod ArgumentFields FilePath
--> Mod ArgumentFields FilePath -> Mod ArgumentFields FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod ArgumentFields FilePath
-forall (f :: * -> *) a. HasCompleter f => FilePath -> Mod f a
-action FilePath
-"directory"
-                                  )
-                              Parser (Maybe Text -> ConfigAddDefaultOptions)
--> Parser (Maybe Text) -> Parser ConfigAddDefaultOptions
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Parser Text -> Parser (Maybe Text)
-forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
-optional (Mod ArgumentFields Text -> Parser Text
-forall s. IsString s => Mod ArgumentFields s -> Parser s
-strArgument (
-                                    FilePath -> Mod ArgumentFields Text
-forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
-metavar FilePath
-"<name>"
-                                    Mod ArgumentFields Text
--> Mod ArgumentFields Text -> Mod ArgumentFields Text
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod ArgumentFields Text
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Optionally give a name to your bookmark"
-                                  ))
-                          )
-
--- | `hoyo check` should be considered equivalent to `hoyo check --config --bookmarks`
-noArgs :: CheckOptions -> CheckOptions
-noArgs :: CheckOptions -> CheckOptions
-noArgs (CheckOptions Bool
-False Bool
-False) = Bool -> Bool -> CheckOptions
-CheckOptions Bool
-True Bool
-True
-noArgs CheckOptions
-opts                       = CheckOptions
-opts
-
--- | Parse options for the @hoyo check@ command.
-checkCommand :: Parser Command
-checkCommand :: Parser Command
-checkCommand = CheckOptions -> Command
-Check (CheckOptions -> Command)
--> (CheckOptions -> CheckOptions) -> CheckOptions -> Command
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. CheckOptions -> CheckOptions
-noArgs (CheckOptions -> Command) -> Parser CheckOptions -> Parser Command
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> (
-                Bool -> Bool -> CheckOptions
-CheckOptions
-                  (Bool -> Bool -> CheckOptions)
--> Parser Bool -> Parser (Bool -> CheckOptions)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Mod FlagFields Bool -> Parser Bool
-switch (FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"config" Mod FlagFields Bool -> Mod FlagFields Bool -> Mod FlagFields Bool
-forall a. Semigroup a => a -> a -> a
-<> Char -> Mod FlagFields Bool
-forall (f :: * -> *) a. HasName f => Char -> Mod f a
-short Char
-'c' Mod FlagFields Bool -> Mod FlagFields Bool -> Mod FlagFields Bool
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Check the config file")
-                  Parser (Bool -> CheckOptions) -> Parser Bool -> Parser CheckOptions
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Mod FlagFields Bool -> Parser Bool
-switch (FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"bookmarks" Mod FlagFields Bool -> Mod FlagFields Bool -> Mod FlagFields Bool
-forall a. Semigroup a => a -> a -> a
-<> Char -> Mod FlagFields Bool
-forall (f :: * -> *) a. HasName f => Char -> Mod f a
-short Char
-'b' Mod FlagFields Bool -> Mod FlagFields Bool -> Mod FlagFields Bool
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod FlagFields Bool
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Check the bookmarks file")
-                )
-
--- | Parse options for the @hoyo help@ command.
-helpCommand :: Parser Command
-helpCommand :: Parser Command
-helpCommand = HelpOptions -> Command
-Help (HelpOptions -> Command)
--> (Maybe Text -> HelpOptions) -> Maybe Text -> Command
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Maybe Text -> HelpOptions
-HelpOptions
-                (Maybe Text -> Command) -> Parser (Maybe Text) -> Parser Command
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Parser Text -> Parser (Maybe Text)
-forall (f :: * -> *) a. Alternative f => f a -> f (Maybe a)
-optional (Mod ArgumentFields Text -> Parser Text
-forall s. IsString s => Mod ArgumentFields s -> Parser s
-strArgument (
-                                FilePath -> Mod ArgumentFields Text
-forall (f :: * -> *) a. HasMetavar f => FilePath -> Mod f a
-metavar FilePath
-"<command>"
-                                Mod ArgumentFields Text
--> Mod ArgumentFields Text -> Mod ArgumentFields Text
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod ArgumentFields Text
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Command to get help with"
-                              )
-                            )
-
--- | If hoyo is run with no arguments, we run the "default command" if it's set.
-defaultCommand :: Parser Command
-defaultCommand :: Parser Command
-defaultCommand = Command -> Parser Command
-forall (f :: * -> *) a. Applicative f => a -> f a
-pure Command
-DefaultCommand
-
--- | Parse a command and the arguments/options for that
--- command from the command-line arguments.
-parseCommand :: Parser Command
-parseCommand :: Parser Command
-parseCommand = (Parser (Command -> Command)
-forall a. Parser (a -> a)
-versionOption Parser (Command -> Command) -> Parser Command -> Parser Command
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Mod CommandFields Command -> Parser Command
-forall a. Mod CommandFields a -> Parser a
-hsubparser (
-  FilePath -> ParserInfo Command -> Mod CommandFields Command
-forall a. FilePath -> ParserInfo a -> Mod CommandFields a
-command FilePath
-"add" (Parser Command -> InfoMod Command -> ParserInfo Command
-forall a. Parser a -> InfoMod a -> ParserInfo a
-info Parser Command
-addCommand (FilePath -> InfoMod Command
-forall a. FilePath -> InfoMod a
-progDesc FilePath
-"Add a bookmark"))
-  Mod CommandFields Command
--> Mod CommandFields Command -> Mod CommandFields Command
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> ParserInfo Command -> Mod CommandFields Command
-forall a. FilePath -> ParserInfo a -> Mod CommandFields a
-command FilePath
-"move" (Parser Command -> InfoMod Command -> ParserInfo Command
-forall a. Parser a -> InfoMod a -> ParserInfo a
-info Parser Command
-moveCommand (FilePath -> InfoMod Command
-forall a. FilePath -> InfoMod a
-progDesc FilePath
-"Change directory using a bookmark"))
-  Mod CommandFields Command
--> Mod CommandFields Command -> Mod CommandFields Command
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> ParserInfo Command -> Mod CommandFields Command
-forall a. FilePath -> ParserInfo a -> Mod CommandFields a
-command FilePath
-"list" (Parser Command -> InfoMod Command -> ParserInfo Command
-forall a. Parser a -> InfoMod a -> ParserInfo a
-info Parser Command
-listCommand (FilePath -> InfoMod Command
-forall a. FilePath -> InfoMod a
-progDesc FilePath
-"List existing bookmarks"))
-  Mod CommandFields Command
--> Mod CommandFields Command -> Mod CommandFields Command
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> ParserInfo Command -> Mod CommandFields Command
-forall a. FilePath -> ParserInfo a -> Mod CommandFields a
-command FilePath
-"clear" (Parser Command -> InfoMod Command -> ParserInfo Command
-forall a. Parser a -> InfoMod a -> ParserInfo a
-info Parser Command
-clearCommand (FilePath -> InfoMod Command
-forall a. FilePath -> InfoMod a
-progDesc FilePath
-"Clear all bookmarks"))
-  Mod CommandFields Command
--> Mod CommandFields Command -> Mod CommandFields Command
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> ParserInfo Command -> Mod CommandFields Command
-forall a. FilePath -> ParserInfo a -> Mod CommandFields a
-command FilePath
-"delete" (Parser Command -> InfoMod Command -> ParserInfo Command
-forall a. Parser a -> InfoMod a -> ParserInfo a
-info Parser Command
-deleteCommand (FilePath -> InfoMod Command
-forall a. FilePath -> InfoMod a
-progDesc FilePath
-"Delete a bookmark"))
-  Mod CommandFields Command
--> Mod CommandFields Command -> Mod CommandFields Command
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> ParserInfo Command -> Mod CommandFields Command
-forall a. FilePath -> ParserInfo a -> Mod CommandFields a
-command FilePath
-"refresh" (Parser Command -> InfoMod Command -> ParserInfo Command
-forall a. Parser a -> InfoMod a -> ParserInfo a
-info Parser Command
-refreshCommand (FilePath -> InfoMod Command
-forall a. FilePath -> InfoMod a
-progDesc FilePath
-"Re-calculate bookmark indices"))
-  Mod CommandFields Command
--> Mod CommandFields Command -> Mod CommandFields Command
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> ParserInfo Command -> Mod CommandFields Command
-forall a. FilePath -> ParserInfo a -> Mod CommandFields a
-command FilePath
-"config" (Parser Command -> InfoMod Command -> ParserInfo Command
-forall a. Parser a -> InfoMod a -> ParserInfo a
-info Parser Command
-configCommand (FilePath -> InfoMod Command
-forall a. FilePath -> InfoMod a
-progDesc FilePath
-"View/manage hoyo config"))
-  Mod CommandFields Command
--> Mod CommandFields Command -> Mod CommandFields Command
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> ParserInfo Command -> Mod CommandFields Command
-forall a. FilePath -> ParserInfo a -> Mod CommandFields a
-command FilePath
-"check" (Parser Command -> InfoMod Command -> ParserInfo Command
-forall a. Parser a -> InfoMod a -> ParserInfo a
-info Parser Command
-checkCommand (FilePath -> InfoMod Command
-forall a. FilePath -> InfoMod a
-progDesc FilePath
-"Verify validity of config and bookmarks"))
-  Mod CommandFields Command
--> Mod CommandFields Command -> Mod CommandFields Command
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> ParserInfo Command -> Mod CommandFields Command
-forall a. FilePath -> ParserInfo a -> Mod CommandFields a
-command FilePath
-"help" (Parser Command -> InfoMod Command -> ParserInfo Command
-forall a. Parser a -> InfoMod a -> ParserInfo a
-info Parser Command
-helpCommand (FilePath -> InfoMod Command
-forall a. FilePath -> InfoMod a
-progDesc FilePath
-"Print a help message for the entire program or a specific command"))
-  )) Parser Command -> Parser Command -> Parser Command
-forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
-<|> Parser Command
-defaultCommand
-
--- | Parse an 'Options' argument, which includes the command
--- to run and any global options.
-parseOptions :: Parser Options
-parseOptions :: Parser Options
-parseOptions = Command -> GlobalOptions -> Options
-Options (Command -> GlobalOptions -> Options)
--> Parser Command -> Parser (GlobalOptions -> Options)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Parser Command
-parseCommand Parser (GlobalOptions -> Options)
--> Parser GlobalOptions -> Parser Options
-forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
-<*> Parser GlobalOptions
-globalOptions
-
--- | Version information printed by `hoyo --version`.
-versionInfo :: String
-versionInfo :: FilePath
-versionInfo =
-  FilePath
-"hoyo "
-  FilePath -> FilePath -> FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath
-versionString
-  FilePath -> FilePath -> FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath
-"\n\nCopyright (c) 2023, Frederick Pringle\n\nAll rights reserved."
-
--- | Add a hidden --version flag to the end of a parser.
-versionOption :: Parser (a -> a)
-versionOption :: Parser (a -> a)
-versionOption = FilePath -> Mod OptionFields (a -> a) -> Parser (a -> a)
-forall a. FilePath -> Mod OptionFields (a -> a) -> Parser (a -> a)
-infoOption FilePath
-versionInfo (
-                  FilePath -> Mod OptionFields (a -> a)
-forall (f :: * -> *) a. HasName f => FilePath -> Mod f a
-long FilePath
-"version"
-                  Mod OptionFields (a -> a)
--> Mod OptionFields (a -> a) -> Mod OptionFields (a -> a)
-forall a. Semigroup a => a -> a -> a
-<> Mod OptionFields (a -> a)
-forall (f :: * -> *) a. Mod f a
-hidden
-                  Mod OptionFields (a -> a)
--> Mod OptionFields (a -> a) -> Mod OptionFields (a -> a)
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Mod OptionFields (a -> a)
-forall (f :: * -> *) a. FilePath -> Mod f a
-help FilePath
-"Display version information and exit"
-                )
-
--- | A footer to display at the end of the long help message.
-hoyoFooter :: Chunk Doc
-hoyoFooter :: Chunk Doc
-hoyoFooter =
-  let
-    withTitle :: FilePath -> f Doc -> f Doc
-withTitle FilePath
-title = (Doc -> Doc) -> f Doc -> f Doc
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-fmap ((FilePath -> Doc
-string FilePath
-title Doc -> Doc -> Doc
-.$.) (Doc -> Doc) -> (Doc -> Doc) -> Doc -> Doc
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Int -> Doc -> Doc
-indent Int
-2)
-    bugText :: Chunk Doc
-bugText = FilePath -> Chunk Doc
-paragraph FilePath
-"If something went wrong unexpectedly or you think there's a problem with hoyo, let me know! To report an issue, create a bug report at https://github.com/fpringle/hoyo/issues"
-    docText :: Chunk Doc
-docText = FilePath -> Chunk Doc
-paragraph FilePath
-"To read the web documentation, visit https://github.com/fpringle/hoyo#readme"
-  in [Chunk Doc] -> Chunk Doc
-vsepChunks [
-        FilePath -> Chunk Doc -> Chunk Doc
-forall (f :: * -> *). Functor f => FilePath -> f Doc -> f Doc
-withTitle FilePath
-"Bugs:" Chunk Doc
-bugText
-      , FilePath -> Chunk Doc -> Chunk Doc
-forall (f :: * -> *). Functor f => FilePath -> f Doc -> f Doc
-withTitle FilePath
-"Online documentation:" Chunk Doc
-docText
-      ]
-
--- | A 'ParserInfo' object containing the necessary information for parsing
--- CLI commands and arguments, and displaying useful help text.
-options :: ParserInfo Options
-options :: ParserInfo Options
-options = Parser Options -> InfoMod Options -> ParserInfo Options
-forall a. Parser a -> InfoMod a -> ParserInfo a
-info (Parser Options
-parseOptions Parser Options -> Parser (Options -> Options) -> Parser Options
-forall (f :: * -> *) a b. Applicative f => f a -> f (a -> b) -> f b
-<**> Parser (Options -> Options)
-forall a. Parser (a -> a)
-helper) (
-          InfoMod Options
-forall a. InfoMod a
-fullDesc
-          InfoMod Options -> InfoMod Options -> InfoMod Options
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> InfoMod Options
-forall a. FilePath -> InfoMod a
-header FilePath
-"Set directory bookmarks for quick \"cd\" behaviour"
-          InfoMod Options -> InfoMod Options -> InfoMod Options
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> InfoMod Options
-forall a. FilePath -> InfoMod a
-progDesc FilePath
-"For more help on a particular sub-command, run `hoyo <cmd> --help`."
-          InfoMod Options -> InfoMod Options -> InfoMod Options
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> InfoMod Options
-forall a. FilePath -> InfoMod a
-footer FilePath
-"for full documentation go to github"
-          InfoMod Options -> InfoMod Options -> InfoMod Options
-forall a. Semigroup a => a -> a -> a
-<> Maybe Doc -> InfoMod Options
-forall a. Maybe Doc -> InfoMod a
-footerDoc (Chunk Doc -> Maybe Doc
-forall a. Chunk a -> Maybe a
-unChunk Chunk Doc
-hoyoFooter)
-          )
-
--- | Show the help message. Pass a non-'Nothing' argument to specify a command.
-showHelp :: Maybe String -> IO ()
-showHelp :: Maybe FilePath -> IO ()
-showHelp Maybe FilePath
-cmd =
-  ParserResult () -> IO ()
-forall a. ParserResult a -> IO a
-handleParseResult
-    (ParserResult () -> IO ()) -> ParserResult () -> IO ()
-forall a b. (a -> b) -> a -> b
-$ ParserFailure ParserHelp -> ParserResult ()
-forall a. ParserFailure ParserHelp -> ParserResult a
-Failure
-    (ParserFailure ParserHelp -> ParserResult ())
--> ParserFailure ParserHelp -> ParserResult ()
-forall a b. (a -> b) -> a -> b
-$ ParserPrefs
--> ParserInfo Options
--> ParseError
--> [Context]
--> ParserFailure ParserHelp
-forall a.
-ParserPrefs
--> ParserInfo a
--> ParseError
--> [Context]
--> ParserFailure ParserHelp
-parserFailure ParserPrefs
-defaultPrefs ParserInfo Options
-options (Maybe FilePath -> ParseError
-ShowHelpText Maybe FilePath
-cmd) []
-
--- | Split a string into arguments as they would be interpreted on the command line.
---
--- Adapted from [this StackOverflow comment](https://stackoverflow.com/a/64236441).
-splitArgs :: T.Text -> [String]
-splitArgs :: Text -> [FilePath]
-splitArgs = Bool -> Bool -> Bool -> FilePath -> FilePath -> [FilePath]
-splitArgs' Bool
-False Bool
-False Bool
-False FilePath
-"" (FilePath -> [FilePath])
--> (Text -> FilePath) -> Text -> [FilePath]
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Text -> FilePath
-T.unpack
-  where
-    splitArgs' :: Bool -> Bool -> Bool -> String -> String -> [String]
-    splitArgs' :: Bool -> Bool -> Bool -> FilePath -> FilePath -> [FilePath]
-splitArgs' Bool
-_ Bool
-_ Bool
-True FilePath
-res [] = [FilePath
-res]
-    splitArgs' Bool
-_ Bool
-_ Bool
-False FilePath
-_ [] = []
-
-    splitArgs' Bool
-False Bool
-_ Bool
-_ FilePath
-res (Char
-'^':FilePath
-rest) = Bool -> Bool -> Bool -> FilePath -> FilePath -> [FilePath]
-splitArgs' Bool
-False Bool
-False Bool
-True (FilePath
-res FilePath -> FilePath -> FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath
-"^") FilePath
-rest
-
-    splitArgs' Bool
-quoted Bool
-True Bool
-_ FilePath
-res (Char
-chr:FilePath
-rest) = Bool -> Bool -> Bool -> FilePath -> FilePath -> [FilePath]
-splitArgs' Bool
-quoted Bool
-False Bool
-True (FilePath
-res FilePath -> FilePath -> FilePath
-forall a. Semigroup a => a -> a -> a
-<> [Char
-chr]) FilePath
-rest
-
-    splitArgs' Bool
-quoted Bool
-escaped Bool
-_ FilePath
-res (Char
-'"':FilePath
-rest) = Bool -> Bool -> Bool -> FilePath -> FilePath -> [FilePath]
-splitArgs' (Bool -> Bool
-not Bool
-quoted) Bool
-escaped Bool
-True FilePath
-res FilePath
-rest
-
-    splitArgs' Bool
-quoted Bool
-False Bool
-started FilePath
-res (Char
-'\\':Char
-'"':FilePath
-rest) = Bool -> Bool -> Bool -> FilePath -> FilePath -> [FilePath]
-splitArgs' Bool
-quoted Bool
-True Bool
-started FilePath
-res (Char
-'"'Char -> FilePath -> FilePath
-forall a. a -> [a] -> [a]
-:FilePath
-rest)
-
-    splitArgs' Bool
-False Bool
-escaped Bool
-started FilePath
-res (Char
-' ':FilePath
-rest) = [FilePath
-res | Bool
-started] [FilePath] -> [FilePath] -> [FilePath]
-forall a. Semigroup a => a -> a -> a
-<> Bool -> Bool -> Bool -> FilePath -> FilePath -> [FilePath]
-splitArgs' Bool
-False Bool
-escaped Bool
-False FilePath
-"" FilePath
-rest
-
-    splitArgs' Bool
-quoted Bool
-escaped Bool
-_ FilePath
-res (Char
-chr:FilePath
-rest) = Bool -> Bool -> Bool -> FilePath -> FilePath -> [FilePath]
-splitArgs' Bool
-quoted Bool
-escaped Bool
-True (FilePath
-res FilePath -> FilePath -> FilePath
-forall a. Semigroup a => a -> a -> a
-<> [Char
-chr]) FilePath
-rest
-
\ No newline at end of file diff --git a/docs/src/HoYo.Internal.Types.html b/docs/src/HoYo.Internal.Types.html deleted file mode 100644 index d68d5c2..0000000 --- a/docs/src/HoYo.Internal.Types.html +++ /dev/null @@ -1,996 +0,0 @@ -
{-|
-Module      : HoYo.Internal.Types
-Copyright   : (c) Frederick Pringle, 2023
-License     : BSD-3-Clause
-Maintainer  : freddyjepringle@gmail.com
-
-Types used by all the main HoYo.* modules.
--}
-
-{-# LANGUAGE DataKinds       #-}
-{-# LANGUAGE GADTs           #-}
-{-# LANGUAGE KindSignatures  #-}
-{-# LANGUAGE RankNTypes      #-}
-{-# LANGUAGE TemplateHaskell #-}
-{-# OPTIONS -Wno-missing-signatures #-}
-{-# OPTIONS_HADDOCK prune #-}
-
-module HoYo.Internal.Types where
-
-import           Control.Monad.Except       (ExceptT, MonadError (..))
-import           Control.Monad.IO.Class
-import           Control.Monad.Reader.Class (MonadReader)
-import           Control.Monad.Trans.Reader (ReaderT)
-
-import           Data.List                  (intercalate)
-import qualified Data.Text                  as T
-import           Data.Time
-
-import           Lens.Micro.TH
-
-import           System.IO.Error
-
--- | The main hoyo read-only environment. Contains the current saved bookmarks,
--- the current hoyo configuration, and the file locations for each.
-data Env
-  = Env { Env -> Bookmarks
-_bookmarks     :: !Bookmarks
-        , Env -> FilePath
-_bookmarksPath :: !FilePath
-        , Env -> Config
-_config        :: !Config
-        , Env -> FilePath
-_configPath    :: !FilePath
-        }
-  deriving (Int -> Env -> ShowS
-[Env] -> ShowS
-Env -> FilePath
-(Int -> Env -> ShowS)
--> (Env -> FilePath) -> ([Env] -> ShowS) -> Show Env
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [Env] -> ShowS
-$cshowList :: [Env] -> ShowS
-show :: Env -> FilePath
-$cshow :: Env -> FilePath
-showsPrec :: Int -> Env -> ShowS
-$cshowsPrec :: Int -> Env -> ShowS
-Show)
-
--- | Bookmark a directory for easy @cd@. A bookmark remembers the directory,
--- the index, the creation time, and optionally a user-specified nickname
--- for the bookmark.
-data Bookmark
-  = Bookmark { Bookmark -> FilePath
-_bookmarkDirectory    :: !FilePath
-             , Bookmark -> Int
-_bookmarkIndex        :: !Int
-             , Bookmark -> ZonedTime
-_bookmarkCreationTime :: !ZonedTime
-             , Bookmark -> Maybe Text
-_bookmarkName         :: !(Maybe T.Text)
-             }
-  deriving (Int -> Bookmark -> ShowS
-[Bookmark] -> ShowS
-Bookmark -> FilePath
-(Int -> Bookmark -> ShowS)
--> (Bookmark -> FilePath) -> ([Bookmark] -> ShowS) -> Show Bookmark
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [Bookmark] -> ShowS
-$cshowList :: [Bookmark] -> ShowS
-show :: Bookmark -> FilePath
-$cshow :: Bookmark -> FilePath
-showsPrec :: Int -> Bookmark -> ShowS
-$cshowsPrec :: Int -> Bookmark -> ShowS
-Show)
-
--- | Default bookmarks to save at init. A default bookmark remembers the directory
--- and optionally a user-specified nickname for the bookmark.
-data DefaultBookmark
-  = DefaultBookmark { DefaultBookmark -> FilePath
-_defaultBookmarkDirectory :: !FilePath
-                    , DefaultBookmark -> Maybe Text
-_defaultBookmarkName      :: !(Maybe T.Text)
-                    }
-  deriving (Int -> DefaultBookmark -> ShowS
-[DefaultBookmark] -> ShowS
-DefaultBookmark -> FilePath
-(Int -> DefaultBookmark -> ShowS)
--> (DefaultBookmark -> FilePath)
--> ([DefaultBookmark] -> ShowS)
--> Show DefaultBookmark
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [DefaultBookmark] -> ShowS
-$cshowList :: [DefaultBookmark] -> ShowS
-show :: DefaultBookmark -> FilePath
-$cshow :: DefaultBookmark -> FilePath
-showsPrec :: Int -> DefaultBookmark -> ShowS
-$cshowsPrec :: Int -> DefaultBookmark -> ShowS
-Show, DefaultBookmark -> DefaultBookmark -> Bool
-(DefaultBookmark -> DefaultBookmark -> Bool)
--> (DefaultBookmark -> DefaultBookmark -> Bool)
--> Eq DefaultBookmark
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: DefaultBookmark -> DefaultBookmark -> Bool
-$c/= :: DefaultBookmark -> DefaultBookmark -> Bool
-== :: DefaultBookmark -> DefaultBookmark -> Bool
-$c== :: DefaultBookmark -> DefaultBookmark -> Bool
-Eq)
-
--- | Wrapper for @['Bookmark']@.
-newtype Bookmarks
-  = Bookmarks { Bookmarks -> [Bookmark]
-unBookmarks :: [Bookmark] }
-  deriving (Int -> Bookmarks -> ShowS
-[Bookmarks] -> ShowS
-Bookmarks -> FilePath
-(Int -> Bookmarks -> ShowS)
--> (Bookmarks -> FilePath)
--> ([Bookmarks] -> ShowS)
--> Show Bookmarks
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [Bookmarks] -> ShowS
-$cshowList :: [Bookmarks] -> ShowS
-show :: Bookmarks -> FilePath
-$cshow :: Bookmarks -> FilePath
-showsPrec :: Int -> Bookmarks -> ShowS
-$cshowsPrec :: Int -> Bookmarks -> ShowS
-Show)
-
--- | Data-type for represting a bookmark search. You can either search
--- by index or by name. Used by the @delete@ and @move@ commands.
-data BookmarkSearchTerm
-  = SearchIndex Int
-  | SearchName T.Text
-  deriving (Int -> BookmarkSearchTerm -> ShowS
-[BookmarkSearchTerm] -> ShowS
-BookmarkSearchTerm -> FilePath
-(Int -> BookmarkSearchTerm -> ShowS)
--> (BookmarkSearchTerm -> FilePath)
--> ([BookmarkSearchTerm] -> ShowS)
--> Show BookmarkSearchTerm
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [BookmarkSearchTerm] -> ShowS
-$cshowList :: [BookmarkSearchTerm] -> ShowS
-show :: BookmarkSearchTerm -> FilePath
-$cshow :: BookmarkSearchTerm -> FilePath
-showsPrec :: Int -> BookmarkSearchTerm -> ShowS
-$cshowsPrec :: Int -> BookmarkSearchTerm -> ShowS
-Show, BookmarkSearchTerm -> BookmarkSearchTerm -> Bool
-(BookmarkSearchTerm -> BookmarkSearchTerm -> Bool)
--> (BookmarkSearchTerm -> BookmarkSearchTerm -> Bool)
--> Eq BookmarkSearchTerm
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: BookmarkSearchTerm -> BookmarkSearchTerm -> Bool
-$c/= :: BookmarkSearchTerm -> BookmarkSearchTerm -> Bool
-== :: BookmarkSearchTerm -> BookmarkSearchTerm -> Bool
-$c== :: BookmarkSearchTerm -> BookmarkSearchTerm -> Bool
-Eq)
-
--- | The types of config values allowed in the HoYo config.
-data ConfigValueType
-  = TBool
-  | TDefaultBookmark
-  | TCommand
-  | TList ConfigValueType
-  | TMaybe ConfigValueType
-
--- | Values in the HoYo config. Using a GADT parameterised by 'ConfigValueType'
--- gives us stricter type safety.
-data ConfigValue (t :: ConfigValueType) where
-  BoolV :: Bool -> ConfigValue 'TBool
-  DefaultBookmarkV :: DefaultBookmark -> ConfigValue 'TDefaultBookmark
-  CommandV :: Command -> ConfigValue 'TCommand
-  ListOfV :: forall (a :: ConfigValueType). [ConfigValue a] -> ConfigValue ('TList a)
-  MaybeV :: forall (a :: ConfigValueType). Maybe (ConfigValue a) -> ConfigValue ('TMaybe a)
-
-instance Show (ConfigValue (t :: ConfigValueType)) where
-  show :: ConfigValue t -> FilePath
-show (BoolV Bool
-bool)          = Bool -> FilePath
-forall a. Show a => a -> FilePath
-show Bool
-bool
-  show (DefaultBookmarkV DefaultBookmark
-bm) = DefaultBookmark -> FilePath
-forall a. Show a => a -> FilePath
-show DefaultBookmark
-bm
-  show (CommandV Command
-t)          = Command -> FilePath
-forall a. Show a => a -> FilePath
-show Command
-t
-  show (ListOfV [ConfigValue a]
-xs)          = FilePath
-"[" FilePath -> ShowS
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> [FilePath] -> FilePath
-forall a. [a] -> [[a]] -> [a]
-intercalate FilePath
-", " ((ConfigValue a -> FilePath) -> [ConfigValue a] -> [FilePath]
-forall a b. (a -> b) -> [a] -> [b]
-map ConfigValue a -> FilePath
-forall a. Show a => a -> FilePath
-show [ConfigValue a]
-xs) FilePath -> ShowS
-forall a. Semigroup a => a -> a -> a
-<> FilePath
-"]"
-  show (MaybeV Maybe (ConfigValue a)
-xs)           = Maybe (ConfigValue a) -> FilePath
-forall a. Show a => a -> FilePath
-show Maybe (ConfigValue a)
-xs
-
-instance Eq (ConfigValue (t :: ConfigValueType)) where
-  BoolV Bool
-b1            == :: ConfigValue t -> ConfigValue t -> Bool
-== BoolV Bool
-b2            = Bool
-b1 Bool -> Bool -> Bool
-forall a. Eq a => a -> a -> Bool
-== Bool
-b2
-  DefaultBookmarkV DefaultBookmark
-b1 == DefaultBookmarkV DefaultBookmark
-b2 = DefaultBookmark
-b1 DefaultBookmark -> DefaultBookmark -> Bool
-forall a. Eq a => a -> a -> Bool
-== DefaultBookmark
-b2
-  CommandV Command
-b1         == CommandV Command
-b2         = Command
-b1 Command -> Command -> Bool
-forall a. Eq a => a -> a -> Bool
-== Command
-b2
-  ListOfV [ConfigValue a]
-b1          == ListOfV [ConfigValue a]
-b2          = [ConfigValue a]
-b1 [ConfigValue a] -> [ConfigValue a] -> Bool
-forall a. Eq a => a -> a -> Bool
-== [ConfigValue a]
-[ConfigValue a]
-b2
-  MaybeV Maybe (ConfigValue a)
-b1           == MaybeV Maybe (ConfigValue a)
-b2           = Maybe (ConfigValue a)
-b1 Maybe (ConfigValue a) -> Maybe (ConfigValue a) -> Bool
-forall a. Eq a => a -> a -> Bool
-== Maybe (ConfigValue a)
-Maybe (ConfigValue a)
-b2
-
--- | Existential wrapper around 'ConfigValue'.
-data AnyConfigValue
-  = forall (t :: ConfigValueType). AnyConfigValue (ConfigValue t)
-
--- | A representation of hoyo settings.
-data Config
-  = Config { Config -> ConfigValue 'TBool
-_failOnError         :: !(ConfigValue 'TBool)
-           , Config -> ConfigValue 'TBool
-_displayCreationTime :: !(ConfigValue 'TBool)
-           , Config -> ConfigValue 'TBool
-_enableClearing      :: !(ConfigValue 'TBool)
-           , Config -> ConfigValue 'TBool
-_enableReset         :: !(ConfigValue 'TBool)
-           , Config -> ConfigValue 'TBool
-_backupBeforeClear   :: !(ConfigValue 'TBool)
-           , Config -> ConfigValue ('TList 'TDefaultBookmark)
-_defaultBookmarks    :: !(ConfigValue ('TList 'TDefaultBookmark))
-           , Config -> ConfigValue ('TMaybe 'TCommand)
-_defaultCommand      :: !(ConfigValue ('TMaybe 'TCommand))
-           }
-  deriving (Int -> Config -> ShowS
-[Config] -> ShowS
-Config -> FilePath
-(Int -> Config -> ShowS)
--> (Config -> FilePath) -> ([Config] -> ShowS) -> Show Config
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [Config] -> ShowS
-$cshowList :: [Config] -> ShowS
-show :: Config -> FilePath
-$cshow :: Config -> FilePath
-showsPrec :: Int -> Config -> ShowS
-$cshowsPrec :: Int -> Config -> ShowS
-Show, Config -> Config -> Bool
-(Config -> Config -> Bool)
--> (Config -> Config -> Bool) -> Eq Config
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: Config -> Config -> Bool
-$c/= :: Config -> Config -> Bool
-== :: Config -> Config -> Bool
-$c== :: Config -> Config -> Bool
-Eq)
-
--- | 'HoYoMonad' is the main monad stack for the hoyo program. It's essentially a wrapper
--- around @ExceptT T.Text (ReaderT Env IO)@: in other words,
--- @HoYoMonad a@ is equivalent to @Env -> IO (Either T.Text a)@
-newtype HoYoMonad a
-  = HoYoMonad { HoYoMonad a -> ExceptT Text (ReaderT Env IO) a
-unHoYo :: ExceptT T.Text (ReaderT Env IO) a }
-  deriving (a -> HoYoMonad b -> HoYoMonad a
-(a -> b) -> HoYoMonad a -> HoYoMonad b
-(forall a b. (a -> b) -> HoYoMonad a -> HoYoMonad b)
--> (forall a b. a -> HoYoMonad b -> HoYoMonad a)
--> Functor HoYoMonad
-forall a b. a -> HoYoMonad b -> HoYoMonad a
-forall a b. (a -> b) -> HoYoMonad a -> HoYoMonad b
-forall (f :: * -> *).
-(forall a b. (a -> b) -> f a -> f b)
--> (forall a b. a -> f b -> f a) -> Functor f
-<$ :: a -> HoYoMonad b -> HoYoMonad a
-$c<$ :: forall a b. a -> HoYoMonad b -> HoYoMonad a
-fmap :: (a -> b) -> HoYoMonad a -> HoYoMonad b
-$cfmap :: forall a b. (a -> b) -> HoYoMonad a -> HoYoMonad b
-Functor, Functor HoYoMonad
-a -> HoYoMonad a
-Functor HoYoMonad
--> (forall a. a -> HoYoMonad a)
--> (forall a b. HoYoMonad (a -> b) -> HoYoMonad a -> HoYoMonad b)
--> (forall a b c.
-    (a -> b -> c) -> HoYoMonad a -> HoYoMonad b -> HoYoMonad c)
--> (forall a b. HoYoMonad a -> HoYoMonad b -> HoYoMonad b)
--> (forall a b. HoYoMonad a -> HoYoMonad b -> HoYoMonad a)
--> Applicative HoYoMonad
-HoYoMonad a -> HoYoMonad b -> HoYoMonad b
-HoYoMonad a -> HoYoMonad b -> HoYoMonad a
-HoYoMonad (a -> b) -> HoYoMonad a -> HoYoMonad b
-(a -> b -> c) -> HoYoMonad a -> HoYoMonad b -> HoYoMonad c
-forall a. a -> HoYoMonad a
-forall a b. HoYoMonad a -> HoYoMonad b -> HoYoMonad a
-forall a b. HoYoMonad a -> HoYoMonad b -> HoYoMonad b
-forall a b. HoYoMonad (a -> b) -> HoYoMonad a -> HoYoMonad b
-forall a b c.
-(a -> b -> c) -> HoYoMonad a -> HoYoMonad b -> HoYoMonad c
-forall (f :: * -> *).
-Functor f
--> (forall a. a -> f a)
--> (forall a b. f (a -> b) -> f a -> f b)
--> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
--> (forall a b. f a -> f b -> f b)
--> (forall a b. f a -> f b -> f a)
--> Applicative f
-<* :: HoYoMonad a -> HoYoMonad b -> HoYoMonad a
-$c<* :: forall a b. HoYoMonad a -> HoYoMonad b -> HoYoMonad a
-*> :: HoYoMonad a -> HoYoMonad b -> HoYoMonad b
-$c*> :: forall a b. HoYoMonad a -> HoYoMonad b -> HoYoMonad b
-liftA2 :: (a -> b -> c) -> HoYoMonad a -> HoYoMonad b -> HoYoMonad c
-$cliftA2 :: forall a b c.
-(a -> b -> c) -> HoYoMonad a -> HoYoMonad b -> HoYoMonad c
-<*> :: HoYoMonad (a -> b) -> HoYoMonad a -> HoYoMonad b
-$c<*> :: forall a b. HoYoMonad (a -> b) -> HoYoMonad a -> HoYoMonad b
-pure :: a -> HoYoMonad a
-$cpure :: forall a. a -> HoYoMonad a
-$cp1Applicative :: Functor HoYoMonad
-Applicative, Applicative HoYoMonad
-a -> HoYoMonad a
-Applicative HoYoMonad
--> (forall a b. HoYoMonad a -> (a -> HoYoMonad b) -> HoYoMonad b)
--> (forall a b. HoYoMonad a -> HoYoMonad b -> HoYoMonad b)
--> (forall a. a -> HoYoMonad a)
--> Monad HoYoMonad
-HoYoMonad a -> (a -> HoYoMonad b) -> HoYoMonad b
-HoYoMonad a -> HoYoMonad b -> HoYoMonad b
-forall a. a -> HoYoMonad a
-forall a b. HoYoMonad a -> HoYoMonad b -> HoYoMonad b
-forall a b. HoYoMonad a -> (a -> HoYoMonad b) -> HoYoMonad b
-forall (m :: * -> *).
-Applicative m
--> (forall a b. m a -> (a -> m b) -> m b)
--> (forall a b. m a -> m b -> m b)
--> (forall a. a -> m a)
--> Monad m
-return :: a -> HoYoMonad a
-$creturn :: forall a. a -> HoYoMonad a
->> :: HoYoMonad a -> HoYoMonad b -> HoYoMonad b
-$c>> :: forall a b. HoYoMonad a -> HoYoMonad b -> HoYoMonad b
->>= :: HoYoMonad a -> (a -> HoYoMonad b) -> HoYoMonad b
-$c>>= :: forall a b. HoYoMonad a -> (a -> HoYoMonad b) -> HoYoMonad b
-$cp1Monad :: Applicative HoYoMonad
-Monad, MonadError T.Text, MonadReader Env)
-
-instance MonadIO HoYoMonad where
-  liftIO :: IO a -> HoYoMonad a
-liftIO IO a
-m = ExceptT Text (ReaderT Env IO) (Either IOError a)
--> HoYoMonad (Either IOError a)
-forall a. ExceptT Text (ReaderT Env IO) a -> HoYoMonad a
-HoYoMonad (IO (Either IOError a)
--> ExceptT Text (ReaderT Env IO) (Either IOError a)
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO (Either IOError a)
- -> ExceptT Text (ReaderT Env IO) (Either IOError a))
--> IO (Either IOError a)
--> ExceptT Text (ReaderT Env IO) (Either IOError a)
-forall a b. (a -> b) -> a -> b
-$ IO a -> IO (Either IOError a)
-forall a. IO a -> IO (Either IOError a)
-tryIOError IO a
-m) HoYoMonad (Either IOError a)
--> (Either IOError a -> HoYoMonad a) -> HoYoMonad a
-forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
->>= \case
-    Left IOError
-err     -> Text -> HoYoMonad a
-forall e (m :: * -> *) a. MonadError e m => e -> m a
-throwError (Text
-"IO error: " Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Text
-T.pack (IOError -> FilePath
-forall a. Show a => a -> FilePath
-show IOError
-err))
-    Right a
-result -> a -> HoYoMonad a
-forall (m :: * -> *) a. Monad m => a -> m a
-return a
-result
-
--- | Options for the "add" command to be parsed from the command-line.
-data AddOptions
-  = AddOptions { AddOptions -> FilePath
-addDirectory :: FilePath
-               , AddOptions -> Maybe Text
-addName      :: Maybe T.Text
-               }
-  deriving (Int -> AddOptions -> ShowS
-[AddOptions] -> ShowS
-AddOptions -> FilePath
-(Int -> AddOptions -> ShowS)
--> (AddOptions -> FilePath)
--> ([AddOptions] -> ShowS)
--> Show AddOptions
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [AddOptions] -> ShowS
-$cshowList :: [AddOptions] -> ShowS
-show :: AddOptions -> FilePath
-$cshow :: AddOptions -> FilePath
-showsPrec :: Int -> AddOptions -> ShowS
-$cshowsPrec :: Int -> AddOptions -> ShowS
-Show, AddOptions -> AddOptions -> Bool
-(AddOptions -> AddOptions -> Bool)
--> (AddOptions -> AddOptions -> Bool) -> Eq AddOptions
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: AddOptions -> AddOptions -> Bool
-$c/= :: AddOptions -> AddOptions -> Bool
-== :: AddOptions -> AddOptions -> Bool
-$c== :: AddOptions -> AddOptions -> Bool
-Eq)
-
--- | Options for the "move" command to be parsed from the command-line.
-newtype MoveOptions
-  = MoveOptions { MoveOptions -> BookmarkSearchTerm
-moveSearch :: BookmarkSearchTerm }
-  deriving (Int -> MoveOptions -> ShowS
-[MoveOptions] -> ShowS
-MoveOptions -> FilePath
-(Int -> MoveOptions -> ShowS)
--> (MoveOptions -> FilePath)
--> ([MoveOptions] -> ShowS)
--> Show MoveOptions
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [MoveOptions] -> ShowS
-$cshowList :: [MoveOptions] -> ShowS
-show :: MoveOptions -> FilePath
-$cshow :: MoveOptions -> FilePath
-showsPrec :: Int -> MoveOptions -> ShowS
-$cshowsPrec :: Int -> MoveOptions -> ShowS
-Show, MoveOptions -> MoveOptions -> Bool
-(MoveOptions -> MoveOptions -> Bool)
--> (MoveOptions -> MoveOptions -> Bool) -> Eq MoveOptions
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: MoveOptions -> MoveOptions -> Bool
-$c/= :: MoveOptions -> MoveOptions -> Bool
-== :: MoveOptions -> MoveOptions -> Bool
-$c== :: MoveOptions -> MoveOptions -> Bool
-Eq)
-
--- | Options for the "list" command to be parsed from the command-line.
-data ListOptions
-  = ListOptions { ListOptions -> Maybe Text
-listFilterName           :: Maybe T.Text
-                , ListOptions -> Maybe Text
-listFilterDirectoryInfix :: Maybe T.Text
-                }
-  deriving (Int -> ListOptions -> ShowS
-[ListOptions] -> ShowS
-ListOptions -> FilePath
-(Int -> ListOptions -> ShowS)
--> (ListOptions -> FilePath)
--> ([ListOptions] -> ShowS)
--> Show ListOptions
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [ListOptions] -> ShowS
-$cshowList :: [ListOptions] -> ShowS
-show :: ListOptions -> FilePath
-$cshow :: ListOptions -> FilePath
-showsPrec :: Int -> ListOptions -> ShowS
-$cshowsPrec :: Int -> ListOptions -> ShowS
-Show, ListOptions -> ListOptions -> Bool
-(ListOptions -> ListOptions -> Bool)
--> (ListOptions -> ListOptions -> Bool) -> Eq ListOptions
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: ListOptions -> ListOptions -> Bool
-$c/= :: ListOptions -> ListOptions -> Bool
-== :: ListOptions -> ListOptions -> Bool
-$c== :: ListOptions -> ListOptions -> Bool
-Eq)
-
--- | Options for the "clear" command to be parsed from the command-line.
-data ClearOptions = ClearOptions deriving (Int -> ClearOptions -> ShowS
-[ClearOptions] -> ShowS
-ClearOptions -> FilePath
-(Int -> ClearOptions -> ShowS)
--> (ClearOptions -> FilePath)
--> ([ClearOptions] -> ShowS)
--> Show ClearOptions
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [ClearOptions] -> ShowS
-$cshowList :: [ClearOptions] -> ShowS
-show :: ClearOptions -> FilePath
-$cshow :: ClearOptions -> FilePath
-showsPrec :: Int -> ClearOptions -> ShowS
-$cshowsPrec :: Int -> ClearOptions -> ShowS
-Show, ClearOptions -> ClearOptions -> Bool
-(ClearOptions -> ClearOptions -> Bool)
--> (ClearOptions -> ClearOptions -> Bool) -> Eq ClearOptions
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: ClearOptions -> ClearOptions -> Bool
-$c/= :: ClearOptions -> ClearOptions -> Bool
-== :: ClearOptions -> ClearOptions -> Bool
-$c== :: ClearOptions -> ClearOptions -> Bool
-Eq)
-
--- | Options for the "delete" command to be parsed from the command-line.
-newtype DeleteOptions
-  = DeleteOptions { DeleteOptions -> BookmarkSearchTerm
-deleteSearch :: BookmarkSearchTerm }
-  deriving (Int -> DeleteOptions -> ShowS
-[DeleteOptions] -> ShowS
-DeleteOptions -> FilePath
-(Int -> DeleteOptions -> ShowS)
--> (DeleteOptions -> FilePath)
--> ([DeleteOptions] -> ShowS)
--> Show DeleteOptions
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [DeleteOptions] -> ShowS
-$cshowList :: [DeleteOptions] -> ShowS
-show :: DeleteOptions -> FilePath
-$cshow :: DeleteOptions -> FilePath
-showsPrec :: Int -> DeleteOptions -> ShowS
-$cshowsPrec :: Int -> DeleteOptions -> ShowS
-Show, DeleteOptions -> DeleteOptions -> Bool
-(DeleteOptions -> DeleteOptions -> Bool)
--> (DeleteOptions -> DeleteOptions -> Bool) -> Eq DeleteOptions
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: DeleteOptions -> DeleteOptions -> Bool
-$c/= :: DeleteOptions -> DeleteOptions -> Bool
-== :: DeleteOptions -> DeleteOptions -> Bool
-$c== :: DeleteOptions -> DeleteOptions -> Bool
-Eq)
-
--- | Options for the "refresh" command to be parsed from the command-line.
-data RefreshOptions = RefreshOptions deriving (Int -> RefreshOptions -> ShowS
-[RefreshOptions] -> ShowS
-RefreshOptions -> FilePath
-(Int -> RefreshOptions -> ShowS)
--> (RefreshOptions -> FilePath)
--> ([RefreshOptions] -> ShowS)
--> Show RefreshOptions
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [RefreshOptions] -> ShowS
-$cshowList :: [RefreshOptions] -> ShowS
-show :: RefreshOptions -> FilePath
-$cshow :: RefreshOptions -> FilePath
-showsPrec :: Int -> RefreshOptions -> ShowS
-$cshowsPrec :: Int -> RefreshOptions -> ShowS
-Show, RefreshOptions -> RefreshOptions -> Bool
-(RefreshOptions -> RefreshOptions -> Bool)
--> (RefreshOptions -> RefreshOptions -> Bool) -> Eq RefreshOptions
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: RefreshOptions -> RefreshOptions -> Bool
-$c/= :: RefreshOptions -> RefreshOptions -> Bool
-== :: RefreshOptions -> RefreshOptions -> Bool
-$c== :: RefreshOptions -> RefreshOptions -> Bool
-Eq)
-
--- | Options for the "config print" command to be parsed from the command-line.
-data ConfigPrintOptions = ConfigPrintOptions deriving (Int -> ConfigPrintOptions -> ShowS
-[ConfigPrintOptions] -> ShowS
-ConfigPrintOptions -> FilePath
-(Int -> ConfigPrintOptions -> ShowS)
--> (ConfigPrintOptions -> FilePath)
--> ([ConfigPrintOptions] -> ShowS)
--> Show ConfigPrintOptions
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [ConfigPrintOptions] -> ShowS
-$cshowList :: [ConfigPrintOptions] -> ShowS
-show :: ConfigPrintOptions -> FilePath
-$cshow :: ConfigPrintOptions -> FilePath
-showsPrec :: Int -> ConfigPrintOptions -> ShowS
-$cshowsPrec :: Int -> ConfigPrintOptions -> ShowS
-Show, ConfigPrintOptions -> ConfigPrintOptions -> Bool
-(ConfigPrintOptions -> ConfigPrintOptions -> Bool)
--> (ConfigPrintOptions -> ConfigPrintOptions -> Bool)
--> Eq ConfigPrintOptions
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: ConfigPrintOptions -> ConfigPrintOptions -> Bool
-$c/= :: ConfigPrintOptions -> ConfigPrintOptions -> Bool
-== :: ConfigPrintOptions -> ConfigPrintOptions -> Bool
-$c== :: ConfigPrintOptions -> ConfigPrintOptions -> Bool
-Eq)
-
--- | Options for the "config reset" command to be parsed from the command-line.
-data ConfigResetOptions = ConfigResetOptions deriving (Int -> ConfigResetOptions -> ShowS
-[ConfigResetOptions] -> ShowS
-ConfigResetOptions -> FilePath
-(Int -> ConfigResetOptions -> ShowS)
--> (ConfigResetOptions -> FilePath)
--> ([ConfigResetOptions] -> ShowS)
--> Show ConfigResetOptions
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [ConfigResetOptions] -> ShowS
-$cshowList :: [ConfigResetOptions] -> ShowS
-show :: ConfigResetOptions -> FilePath
-$cshow :: ConfigResetOptions -> FilePath
-showsPrec :: Int -> ConfigResetOptions -> ShowS
-$cshowsPrec :: Int -> ConfigResetOptions -> ShowS
-Show, ConfigResetOptions -> ConfigResetOptions -> Bool
-(ConfigResetOptions -> ConfigResetOptions -> Bool)
--> (ConfigResetOptions -> ConfigResetOptions -> Bool)
--> Eq ConfigResetOptions
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: ConfigResetOptions -> ConfigResetOptions -> Bool
-$c/= :: ConfigResetOptions -> ConfigResetOptions -> Bool
-== :: ConfigResetOptions -> ConfigResetOptions -> Bool
-$c== :: ConfigResetOptions -> ConfigResetOptions -> Bool
-Eq)
-
--- | Options for the "config set" command to be parsed from the command-line.
-data ConfigSetOptions
-  = ConfigSetOptions { ConfigSetOptions -> Text
-setKey   :: T.Text
-                     , ConfigSetOptions -> Text
-setValue :: T.Text
-                     }
-  deriving (Int -> ConfigSetOptions -> ShowS
-[ConfigSetOptions] -> ShowS
-ConfigSetOptions -> FilePath
-(Int -> ConfigSetOptions -> ShowS)
--> (ConfigSetOptions -> FilePath)
--> ([ConfigSetOptions] -> ShowS)
--> Show ConfigSetOptions
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [ConfigSetOptions] -> ShowS
-$cshowList :: [ConfigSetOptions] -> ShowS
-show :: ConfigSetOptions -> FilePath
-$cshow :: ConfigSetOptions -> FilePath
-showsPrec :: Int -> ConfigSetOptions -> ShowS
-$cshowsPrec :: Int -> ConfigSetOptions -> ShowS
-Show, ConfigSetOptions -> ConfigSetOptions -> Bool
-(ConfigSetOptions -> ConfigSetOptions -> Bool)
--> (ConfigSetOptions -> ConfigSetOptions -> Bool)
--> Eq ConfigSetOptions
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: ConfigSetOptions -> ConfigSetOptions -> Bool
-$c/= :: ConfigSetOptions -> ConfigSetOptions -> Bool
-== :: ConfigSetOptions -> ConfigSetOptions -> Bool
-$c== :: ConfigSetOptions -> ConfigSetOptions -> Bool
-Eq)
-
--- | Options for the "config add-default" command to be parsed from the command-line.
-data ConfigAddDefaultOptions
-  = ConfigAddDefaultOptions { ConfigAddDefaultOptions -> FilePath
-addDefaultDir  :: FilePath
-                            , ConfigAddDefaultOptions -> Maybe Text
-addDefaultName :: Maybe T.Text
-                            }
-  deriving (Int -> ConfigAddDefaultOptions -> ShowS
-[ConfigAddDefaultOptions] -> ShowS
-ConfigAddDefaultOptions -> FilePath
-(Int -> ConfigAddDefaultOptions -> ShowS)
--> (ConfigAddDefaultOptions -> FilePath)
--> ([ConfigAddDefaultOptions] -> ShowS)
--> Show ConfigAddDefaultOptions
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [ConfigAddDefaultOptions] -> ShowS
-$cshowList :: [ConfigAddDefaultOptions] -> ShowS
-show :: ConfigAddDefaultOptions -> FilePath
-$cshow :: ConfigAddDefaultOptions -> FilePath
-showsPrec :: Int -> ConfigAddDefaultOptions -> ShowS
-$cshowsPrec :: Int -> ConfigAddDefaultOptions -> ShowS
-Show, ConfigAddDefaultOptions -> ConfigAddDefaultOptions -> Bool
-(ConfigAddDefaultOptions -> ConfigAddDefaultOptions -> Bool)
--> (ConfigAddDefaultOptions -> ConfigAddDefaultOptions -> Bool)
--> Eq ConfigAddDefaultOptions
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: ConfigAddDefaultOptions -> ConfigAddDefaultOptions -> Bool
-$c/= :: ConfigAddDefaultOptions -> ConfigAddDefaultOptions -> Bool
-== :: ConfigAddDefaultOptions -> ConfigAddDefaultOptions -> Bool
-$c== :: ConfigAddDefaultOptions -> ConfigAddDefaultOptions -> Bool
-Eq)
-
--- | Options for the "config" command to be parsed from the command-line.
-data ConfigCommand
-  = Print ConfigPrintOptions
-  | Reset ConfigResetOptions
-  | Set ConfigSetOptions
-  | AddDefaultBookmark ConfigAddDefaultOptions
-  deriving (Int -> ConfigCommand -> ShowS
-[ConfigCommand] -> ShowS
-ConfigCommand -> FilePath
-(Int -> ConfigCommand -> ShowS)
--> (ConfigCommand -> FilePath)
--> ([ConfigCommand] -> ShowS)
--> Show ConfigCommand
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [ConfigCommand] -> ShowS
-$cshowList :: [ConfigCommand] -> ShowS
-show :: ConfigCommand -> FilePath
-$cshow :: ConfigCommand -> FilePath
-showsPrec :: Int -> ConfigCommand -> ShowS
-$cshowsPrec :: Int -> ConfigCommand -> ShowS
-Show, ConfigCommand -> ConfigCommand -> Bool
-(ConfigCommand -> ConfigCommand -> Bool)
--> (ConfigCommand -> ConfigCommand -> Bool) -> Eq ConfigCommand
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: ConfigCommand -> ConfigCommand -> Bool
-$c/= :: ConfigCommand -> ConfigCommand -> Bool
-== :: ConfigCommand -> ConfigCommand -> Bool
-$c== :: ConfigCommand -> ConfigCommand -> Bool
-Eq)
-
--- | Options for the "check" command to be parsed from the command-line.
-data CheckOptions
-  = CheckOptions { CheckOptions -> Bool
-checkConfig    :: Bool
-                 , CheckOptions -> Bool
-checkBookmarks :: Bool
-                 }
-  deriving (Int -> CheckOptions -> ShowS
-[CheckOptions] -> ShowS
-CheckOptions -> FilePath
-(Int -> CheckOptions -> ShowS)
--> (CheckOptions -> FilePath)
--> ([CheckOptions] -> ShowS)
--> Show CheckOptions
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [CheckOptions] -> ShowS
-$cshowList :: [CheckOptions] -> ShowS
-show :: CheckOptions -> FilePath
-$cshow :: CheckOptions -> FilePath
-showsPrec :: Int -> CheckOptions -> ShowS
-$cshowsPrec :: Int -> CheckOptions -> ShowS
-Show, CheckOptions -> CheckOptions -> Bool
-(CheckOptions -> CheckOptions -> Bool)
--> (CheckOptions -> CheckOptions -> Bool) -> Eq CheckOptions
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: CheckOptions -> CheckOptions -> Bool
-$c/= :: CheckOptions -> CheckOptions -> Bool
-== :: CheckOptions -> CheckOptions -> Bool
-$c== :: CheckOptions -> CheckOptions -> Bool
-Eq)
-
-newtype HelpOptions
-  = HelpOptions { HelpOptions -> Maybe Text
-helpSubcommand :: Maybe T.Text }
-  deriving (Int -> HelpOptions -> ShowS
-[HelpOptions] -> ShowS
-HelpOptions -> FilePath
-(Int -> HelpOptions -> ShowS)
--> (HelpOptions -> FilePath)
--> ([HelpOptions] -> ShowS)
--> Show HelpOptions
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [HelpOptions] -> ShowS
-$cshowList :: [HelpOptions] -> ShowS
-show :: HelpOptions -> FilePath
-$cshow :: HelpOptions -> FilePath
-showsPrec :: Int -> HelpOptions -> ShowS
-$cshowsPrec :: Int -> HelpOptions -> ShowS
-Show, HelpOptions -> HelpOptions -> Bool
-(HelpOptions -> HelpOptions -> Bool)
--> (HelpOptions -> HelpOptions -> Bool) -> Eq HelpOptions
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: HelpOptions -> HelpOptions -> Bool
-$c/= :: HelpOptions -> HelpOptions -> Bool
-== :: HelpOptions -> HelpOptions -> Bool
-$c== :: HelpOptions -> HelpOptions -> Bool
-Eq)
-
--- | The core data-type for the hoyo CLI. The 'Command' is parsed from the command-line,
--- then 'HoYo.Command.runCommand' dispatches on the type.
-data Command
-  = Add AddOptions
-  | Move MoveOptions
-  | List ListOptions
-  | Clear ClearOptions
-  | Delete DeleteOptions
-  | Refresh RefreshOptions
-  | ConfigCmd ConfigCommand
-  | Check CheckOptions
-  | DefaultCommand
-  | Help HelpOptions
-  deriving (Int -> Command -> ShowS
-[Command] -> ShowS
-Command -> FilePath
-(Int -> Command -> ShowS)
--> (Command -> FilePath) -> ([Command] -> ShowS) -> Show Command
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [Command] -> ShowS
-$cshowList :: [Command] -> ShowS
-show :: Command -> FilePath
-$cshow :: Command -> FilePath
-showsPrec :: Int -> Command -> ShowS
-$cshowsPrec :: Int -> Command -> ShowS
-Show, Command -> Command -> Bool
-(Command -> Command -> Bool)
--> (Command -> Command -> Bool) -> Eq Command
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: Command -> Command -> Bool
-$c/= :: Command -> Command -> Bool
-== :: Command -> Command -> Bool
-$c== :: Command -> Command -> Bool
-Eq)
-
--- | Datatype for representing a command-line settings override.
-data MaybeOverride = OverrideFalse | OverrideTrue | NoOverride | Conflict deriving
-  ( Int -> MaybeOverride -> ShowS
-[MaybeOverride] -> ShowS
-MaybeOverride -> FilePath
-(Int -> MaybeOverride -> ShowS)
--> (MaybeOverride -> FilePath)
--> ([MaybeOverride] -> ShowS)
--> Show MaybeOverride
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [MaybeOverride] -> ShowS
-$cshowList :: [MaybeOverride] -> ShowS
-show :: MaybeOverride -> FilePath
-$cshow :: MaybeOverride -> FilePath
-showsPrec :: Int -> MaybeOverride -> ShowS
-$cshowsPrec :: Int -> MaybeOverride -> ShowS
-Show
-  , MaybeOverride -> MaybeOverride -> Bool
-(MaybeOverride -> MaybeOverride -> Bool)
--> (MaybeOverride -> MaybeOverride -> Bool) -> Eq MaybeOverride
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: MaybeOverride -> MaybeOverride -> Bool
-$c/= :: MaybeOverride -> MaybeOverride -> Bool
-== :: MaybeOverride -> MaybeOverride -> Bool
-$c== :: MaybeOverride -> MaybeOverride -> Bool
-Eq
-  )
-
--- | Config settings that can be overriden using command-line flags.
-data OverrideOptions
-  = OverrideOptions { OverrideOptions -> MaybeOverride
-overrideFailOnError         :: MaybeOverride
-                    , OverrideOptions -> MaybeOverride
-overrideDisplayCreationTime :: MaybeOverride
-                    , OverrideOptions -> MaybeOverride
-overrideEnableClearing      :: MaybeOverride
-                    , OverrideOptions -> MaybeOverride
-overrideEnableReset         :: MaybeOverride
-                    , OverrideOptions -> MaybeOverride
-overrideBackupBeforeClear   :: MaybeOverride
-                    }
-  deriving (Int -> OverrideOptions -> ShowS
-[OverrideOptions] -> ShowS
-OverrideOptions -> FilePath
-(Int -> OverrideOptions -> ShowS)
--> (OverrideOptions -> FilePath)
--> ([OverrideOptions] -> ShowS)
--> Show OverrideOptions
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [OverrideOptions] -> ShowS
-$cshowList :: [OverrideOptions] -> ShowS
-show :: OverrideOptions -> FilePath
-$cshow :: OverrideOptions -> FilePath
-showsPrec :: Int -> OverrideOptions -> ShowS
-$cshowsPrec :: Int -> OverrideOptions -> ShowS
-Show, OverrideOptions -> OverrideOptions -> Bool
-(OverrideOptions -> OverrideOptions -> Bool)
--> (OverrideOptions -> OverrideOptions -> Bool)
--> Eq OverrideOptions
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: OverrideOptions -> OverrideOptions -> Bool
-$c/= :: OverrideOptions -> OverrideOptions -> Bool
-== :: OverrideOptions -> OverrideOptions -> Bool
-$c== :: OverrideOptions -> OverrideOptions -> Bool
-Eq)
-
--- | CLI options that can be set regardless of which command is run.
-data GlobalOptions
-  = GlobalOptions { GlobalOptions -> Maybe FilePath
-globalConfigPath :: Maybe FilePath
-                  , GlobalOptions -> Maybe FilePath
-dataPath         :: Maybe FilePath
-                  , GlobalOptions -> OverrideOptions
-overrides        :: OverrideOptions
-                  }
-  deriving (Int -> GlobalOptions -> ShowS
-[GlobalOptions] -> ShowS
-GlobalOptions -> FilePath
-(Int -> GlobalOptions -> ShowS)
--> (GlobalOptions -> FilePath)
--> ([GlobalOptions] -> ShowS)
--> Show GlobalOptions
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [GlobalOptions] -> ShowS
-$cshowList :: [GlobalOptions] -> ShowS
-show :: GlobalOptions -> FilePath
-$cshow :: GlobalOptions -> FilePath
-showsPrec :: Int -> GlobalOptions -> ShowS
-$cshowsPrec :: Int -> GlobalOptions -> ShowS
-Show, GlobalOptions -> GlobalOptions -> Bool
-(GlobalOptions -> GlobalOptions -> Bool)
--> (GlobalOptions -> GlobalOptions -> Bool) -> Eq GlobalOptions
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: GlobalOptions -> GlobalOptions -> Bool
-$c/= :: GlobalOptions -> GlobalOptions -> Bool
-== :: GlobalOptions -> GlobalOptions -> Bool
-$c== :: GlobalOptions -> GlobalOptions -> Bool
-Eq)
-
--- | The final result of parsing the CLI arguments. Contains a command and all
--- information for that command, and any global options that have been set.
-data Options
-  = Options { Options -> Command
-optCommand :: Command
-            , Options -> GlobalOptions
-optGlobals :: GlobalOptions
-            }
-  deriving (Int -> Options -> ShowS
-[Options] -> ShowS
-Options -> FilePath
-(Int -> Options -> ShowS)
--> (Options -> FilePath) -> ([Options] -> ShowS) -> Show Options
-forall a.
-(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
-showList :: [Options] -> ShowS
-$cshowList :: [Options] -> ShowS
-show :: Options -> FilePath
-$cshow :: Options -> FilePath
-showsPrec :: Int -> Options -> ShowS
-$cshowsPrec :: Int -> Options -> ShowS
-Show, Options -> Options -> Bool
-(Options -> Options -> Bool)
--> (Options -> Options -> Bool) -> Eq Options
-forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
-/= :: Options -> Options -> Bool
-$c/= :: Options -> Options -> Bool
-== :: Options -> Options -> Bool
-$c== :: Options -> Options -> Bool
-Eq)
-
-makeLenses ''Bookmark
-makeLenses ''DefaultBookmark
-makeLenses ''Env
-
\ No newline at end of file diff --git a/docs/src/HoYo.Internal.Utils.html b/docs/src/HoYo.Internal.Utils.html deleted file mode 100644 index 25bbbd9..0000000 --- a/docs/src/HoYo.Internal.Utils.html +++ /dev/null @@ -1,1266 +0,0 @@ -
{-|
-Module      : HoYo.Internal.Utils
-Copyright   : (c) Frederick Pringle, 2023
-License     : BSD-3-Clause
-Maintainer  : freddyjepringle@gmail.com
-
-Utility functions used by all the main HoYo.* modules.
--}
-
-{-# LANGUAGE DataKinds  #-}
-{-# LANGUAGE GADTs      #-}
-{-# LANGUAGE RankNTypes #-}
-{-# OPTIONS_HADDOCK prune #-}
-
-module HoYo.Internal.Utils where
-
-{- HLINT ignore "Use list comprehension" -}
-
-import           Control.Applicative
-import           Control.Monad              (unless, when)
-import           Control.Monad.Except
-                 ( MonadError (..)
-                 , liftEither
-                 , throwError
-                 )
-import           Control.Monad.IO.Class
-import           Control.Monad.Reader.Class (MonadReader, asks)
-
-import           Data.Bifunctor             (bimap, first)
-import           Data.Maybe
-import qualified Data.Text                  as T
-import qualified Data.Text.IO               as T
-import           Data.Time
-
-import           HoYo.Internal.Types
-
-import           Lens.Micro
-import           Lens.Micro.Extras
-
-import           System.Console.ANSI        hiding (Reset)
-import           System.Directory
-import           System.IO
-
-import           Text.Read                  (readEither)
-
-import qualified Toml.Parser.Core           as Toml
-                 ( eof
-                 , errorBundlePretty
-                 , parse
-                 )
-import qualified Toml.Parser.Value          as Toml
-
-
------------------------------------------
--- getters and setter for ConfigValue
-
-getBool :: ConfigValue 'TBool -> Bool
-getBool :: ConfigValue 'TBool -> Bool
-getBool (BoolV Bool
-bool) = Bool
-bool
-
-setBool :: ConfigValue 'TBool -> Bool -> ConfigValue 'TBool
-setBool :: ConfigValue 'TBool -> Bool -> ConfigValue 'TBool
-setBool ConfigValue 'TBool
-_ = Bool -> ConfigValue 'TBool
-BoolV
-
-getDefaultBookmark :: ConfigValue 'TDefaultBookmark -> DefaultBookmark
-getDefaultBookmark :: ConfigValue 'TDefaultBookmark -> DefaultBookmark
-getDefaultBookmark (DefaultBookmarkV DefaultBookmark
-bm) = DefaultBookmark
-bm
-
-setDefaultBookmark :: ConfigValue 'TDefaultBookmark -> DefaultBookmark -> ConfigValue 'TDefaultBookmark
-setDefaultBookmark :: ConfigValue 'TDefaultBookmark
--> DefaultBookmark -> ConfigValue 'TDefaultBookmark
-setDefaultBookmark ConfigValue 'TDefaultBookmark
-_ = DefaultBookmark -> ConfigValue 'TDefaultBookmark
-DefaultBookmarkV
-
-getCommand :: ConfigValue 'TCommand -> Command
-getCommand :: ConfigValue 'TCommand -> Command
-getCommand (CommandV Command
-t) = Command
-t
-
-setCommand :: ConfigValue 'TCommand -> Command -> ConfigValue 'TCommand
-setCommand :: ConfigValue 'TCommand -> Command -> ConfigValue 'TCommand
-setCommand ConfigValue 'TCommand
-_ = Command -> ConfigValue 'TCommand
-CommandV
-
-getList :: ConfigValue ('TList t) -> [ConfigValue t]
-getList :: ConfigValue ('TList t) -> [ConfigValue t]
-getList (ListOfV [ConfigValue a]
-xs) = [ConfigValue t]
-[ConfigValue a]
-xs
-
-setList :: ConfigValue ('TList t) -> [ConfigValue t] -> ConfigValue ('TList t)
-setList :: ConfigValue ('TList t) -> [ConfigValue t] -> ConfigValue ('TList t)
-setList ConfigValue ('TList t)
-_ = [ConfigValue t] -> ConfigValue ('TList t)
-forall (a :: ConfigValueType).
-[ConfigValue a] -> ConfigValue ('TList a)
-ListOfV
-
-getMaybe :: ConfigValue ('TMaybe t) -> Maybe (ConfigValue t)
-getMaybe :: ConfigValue ('TMaybe t) -> Maybe (ConfigValue t)
-getMaybe (MaybeV Maybe (ConfigValue a)
-val) = Maybe (ConfigValue t)
-Maybe (ConfigValue a)
-val
-
-setMaybe :: ConfigValue ('TMaybe t) -> Maybe (ConfigValue t) -> ConfigValue ('TMaybe t)
-setMaybe :: ConfigValue ('TMaybe t)
--> Maybe (ConfigValue t) -> ConfigValue ('TMaybe t)
-setMaybe ConfigValue ('TMaybe t)
-_ = Maybe (ConfigValue t) -> ConfigValue ('TMaybe t)
-forall (a :: ConfigValueType).
-Maybe (ConfigValue a) -> ConfigValue ('TMaybe a)
-MaybeV
-
------------------------------------------
--- Lenses for Config
-
-failOnError :: Lens' Config Bool
-failOnError :: (Bool -> f Bool) -> Config -> f Config
-failOnError = (Config -> Bool)
--> (Config -> Bool -> Config) -> Lens Config Config Bool Bool
-forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
-lens Config -> Bool
-getter Config -> Bool -> Config
-setter
-  where
-    getter :: Config -> Bool
-getter = ConfigValue 'TBool -> Bool
-getBool (ConfigValue 'TBool -> Bool)
--> (Config -> ConfigValue 'TBool) -> Config -> Bool
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Config -> ConfigValue 'TBool
-_failOnError
-    setter :: Config -> Bool -> Config
-setter Config
-cfg Bool
-bool = Config
-cfg { _failOnError :: ConfigValue 'TBool
-_failOnError = ConfigValue 'TBool -> Bool -> ConfigValue 'TBool
-setBool (Config -> ConfigValue 'TBool
-_failOnError Config
-cfg) Bool
-bool }
-
-displayCreationTime :: Lens' Config Bool
-displayCreationTime :: (Bool -> f Bool) -> Config -> f Config
-displayCreationTime = (Config -> Bool)
--> (Config -> Bool -> Config) -> Lens Config Config Bool Bool
-forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
-lens Config -> Bool
-getter Config -> Bool -> Config
-setter
-  where
-    getter :: Config -> Bool
-getter = ConfigValue 'TBool -> Bool
-getBool (ConfigValue 'TBool -> Bool)
--> (Config -> ConfigValue 'TBool) -> Config -> Bool
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Config -> ConfigValue 'TBool
-_displayCreationTime
-    setter :: Config -> Bool -> Config
-setter Config
-cfg Bool
-bool = Config
-cfg { _displayCreationTime :: ConfigValue 'TBool
-_displayCreationTime = ConfigValue 'TBool -> Bool -> ConfigValue 'TBool
-setBool (Config -> ConfigValue 'TBool
-_displayCreationTime Config
-cfg) Bool
-bool }
-
-enableClearing :: Lens' Config Bool
-enableClearing :: (Bool -> f Bool) -> Config -> f Config
-enableClearing = (Config -> Bool)
--> (Config -> Bool -> Config) -> Lens Config Config Bool Bool
-forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
-lens Config -> Bool
-getter Config -> Bool -> Config
-setter
-  where
-    getter :: Config -> Bool
-getter = ConfigValue 'TBool -> Bool
-getBool (ConfigValue 'TBool -> Bool)
--> (Config -> ConfigValue 'TBool) -> Config -> Bool
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Config -> ConfigValue 'TBool
-_enableClearing
-    setter :: Config -> Bool -> Config
-setter Config
-cfg Bool
-bool = Config
-cfg { _enableClearing :: ConfigValue 'TBool
-_enableClearing = ConfigValue 'TBool -> Bool -> ConfigValue 'TBool
-setBool (Config -> ConfigValue 'TBool
-_enableClearing Config
-cfg) Bool
-bool }
-
-enableReset :: Lens' Config Bool
-enableReset :: (Bool -> f Bool) -> Config -> f Config
-enableReset = (Config -> Bool)
--> (Config -> Bool -> Config) -> Lens Config Config Bool Bool
-forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
-lens Config -> Bool
-getter Config -> Bool -> Config
-setter
-  where
-    getter :: Config -> Bool
-getter = ConfigValue 'TBool -> Bool
-getBool (ConfigValue 'TBool -> Bool)
--> (Config -> ConfigValue 'TBool) -> Config -> Bool
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Config -> ConfigValue 'TBool
-_enableReset
-    setter :: Config -> Bool -> Config
-setter Config
-cfg Bool
-bool = Config
-cfg { _enableReset :: ConfigValue 'TBool
-_enableReset = ConfigValue 'TBool -> Bool -> ConfigValue 'TBool
-setBool (Config -> ConfigValue 'TBool
-_enableReset Config
-cfg) Bool
-bool }
-
-backupBeforeClear :: Lens' Config Bool
-backupBeforeClear :: (Bool -> f Bool) -> Config -> f Config
-backupBeforeClear = (Config -> Bool)
--> (Config -> Bool -> Config) -> Lens Config Config Bool Bool
-forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
-lens Config -> Bool
-getter Config -> Bool -> Config
-setter
-  where
-    getter :: Config -> Bool
-getter = ConfigValue 'TBool -> Bool
-getBool (ConfigValue 'TBool -> Bool)
--> (Config -> ConfigValue 'TBool) -> Config -> Bool
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Config -> ConfigValue 'TBool
-_backupBeforeClear
-    setter :: Config -> Bool -> Config
-setter Config
-cfg Bool
-bool = Config
-cfg { _backupBeforeClear :: ConfigValue 'TBool
-_backupBeforeClear = ConfigValue 'TBool -> Bool -> ConfigValue 'TBool
-setBool (Config -> ConfigValue 'TBool
-_backupBeforeClear Config
-cfg) Bool
-bool }
-
-defaultBookmarks :: Lens' Config [DefaultBookmark]
-defaultBookmarks :: ([DefaultBookmark] -> f [DefaultBookmark]) -> Config -> f Config
-defaultBookmarks = (Config -> [DefaultBookmark])
--> (Config -> [DefaultBookmark] -> Config)
--> Lens Config Config [DefaultBookmark] [DefaultBookmark]
-forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
-lens Config -> [DefaultBookmark]
-getter Config -> [DefaultBookmark] -> Config
-setter
-  where
-    getter :: Config -> [DefaultBookmark]
-    getter :: Config -> [DefaultBookmark]
-getter = (ConfigValue 'TDefaultBookmark -> DefaultBookmark)
--> [ConfigValue 'TDefaultBookmark] -> [DefaultBookmark]
-forall a b. (a -> b) -> [a] -> [b]
-map ConfigValue 'TDefaultBookmark -> DefaultBookmark
-getDefaultBookmark ([ConfigValue 'TDefaultBookmark] -> [DefaultBookmark])
--> (Config -> [ConfigValue 'TDefaultBookmark])
--> Config
--> [DefaultBookmark]
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. ConfigValue ('TList 'TDefaultBookmark)
--> [ConfigValue 'TDefaultBookmark]
-forall (t :: ConfigValueType).
-ConfigValue ('TList t) -> [ConfigValue t]
-getList (ConfigValue ('TList 'TDefaultBookmark)
- -> [ConfigValue 'TDefaultBookmark])
--> (Config -> ConfigValue ('TList 'TDefaultBookmark))
--> Config
--> [ConfigValue 'TDefaultBookmark]
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Config -> ConfigValue ('TList 'TDefaultBookmark)
-_defaultBookmarks
-
-    setter :: Config -> [DefaultBookmark] -> Config
-    setter :: Config -> [DefaultBookmark] -> Config
-setter Config
-cfg [DefaultBookmark]
-bms = Config
-cfg { _defaultBookmarks :: ConfigValue ('TList 'TDefaultBookmark)
-_defaultBookmarks = ConfigValue ('TList 'TDefaultBookmark)
--> [ConfigValue 'TDefaultBookmark]
--> ConfigValue ('TList 'TDefaultBookmark)
-forall (t :: ConfigValueType).
-ConfigValue ('TList t) -> [ConfigValue t] -> ConfigValue ('TList t)
-setList (Config -> ConfigValue ('TList 'TDefaultBookmark)
-_defaultBookmarks Config
-cfg) ((DefaultBookmark -> ConfigValue 'TDefaultBookmark)
--> [DefaultBookmark] -> [ConfigValue 'TDefaultBookmark]
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-fmap DefaultBookmark -> ConfigValue 'TDefaultBookmark
-DefaultBookmarkV [DefaultBookmark]
-bms)}
-
-defaultCommand :: Lens' Config (Maybe Command)
-defaultCommand :: (Maybe Command -> f (Maybe Command)) -> Config -> f Config
-defaultCommand = (Config -> Maybe Command)
--> (Config -> Maybe Command -> Config)
--> Lens Config Config (Maybe Command) (Maybe Command)
-forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
-lens Config -> Maybe Command
-getter Config -> Maybe Command -> Config
-setter
-  where
-    getter :: Config -> Maybe Command
-    getter :: Config -> Maybe Command
-getter = (ConfigValue 'TCommand -> Command)
--> Maybe (ConfigValue 'TCommand) -> Maybe Command
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-fmap ConfigValue 'TCommand -> Command
-getCommand (Maybe (ConfigValue 'TCommand) -> Maybe Command)
--> (Config -> Maybe (ConfigValue 'TCommand))
--> Config
--> Maybe Command
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. ConfigValue ('TMaybe 'TCommand) -> Maybe (ConfigValue 'TCommand)
-forall (t :: ConfigValueType).
-ConfigValue ('TMaybe t) -> Maybe (ConfigValue t)
-getMaybe (ConfigValue ('TMaybe 'TCommand) -> Maybe (ConfigValue 'TCommand))
--> (Config -> ConfigValue ('TMaybe 'TCommand))
--> Config
--> Maybe (ConfigValue 'TCommand)
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Config -> ConfigValue ('TMaybe 'TCommand)
-_defaultCommand
-
-    setter :: Config -> Maybe Command -> Config
-    setter :: Config -> Maybe Command -> Config
-setter Config
-cfg Maybe Command
-cmd = Config
-cfg { _defaultCommand :: ConfigValue ('TMaybe 'TCommand)
-_defaultCommand = ConfigValue ('TMaybe 'TCommand)
--> Maybe (ConfigValue 'TCommand) -> ConfigValue ('TMaybe 'TCommand)
-forall (t :: ConfigValueType).
-ConfigValue ('TMaybe t)
--> Maybe (ConfigValue t) -> ConfigValue ('TMaybe t)
-setMaybe (Config -> ConfigValue ('TMaybe 'TCommand)
-_defaultCommand Config
-cfg) ((Command -> ConfigValue 'TCommand)
--> Maybe Command -> Maybe (ConfigValue 'TCommand)
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-fmap Command -> ConfigValue 'TCommand
-CommandV Maybe Command
-cmd) }
-
------------------------------------------
-
--- | A version of the lens "use" function for 'MonadReader'.
-asks' :: MonadReader a m => SimpleGetter a b -> m b
-asks' :: SimpleGetter a b -> m b
-asks' = (a -> b) -> m b
-forall r (m :: * -> *) a. MonadReader r m => (r -> a) -> m a
-asks ((a -> b) -> m b)
--> (Getting b a b -> a -> b) -> Getting b a b -> m b
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Getting b a b -> a -> b
-forall a s. Getting a s a -> s -> a
-view
-
--- | Take the maximum of a list, with a default value if the list is empty.
-maximumDefault :: Ord a => a -> [a] -> a
-maximumDefault :: a -> [a] -> a
-maximumDefault a
-def [] = a
-def
-maximumDefault a
-_ [a]
-xs   = [a] -> a
-forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
-maximum [a]
-xs
-
--- | Throw an error if a check fails.
-assert :: T.Text -> HoYoMonad Bool -> HoYoMonad ()
-assert :: Text -> HoYoMonad Bool -> HoYoMonad ()
-assert Text
-err HoYoMonad Bool
-check = do
-  Bool
-res <- HoYoMonad Bool
-check
-  Bool -> HoYoMonad () -> HoYoMonad ()
-forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
-unless Bool
-res (HoYoMonad () -> HoYoMonad ()) -> HoYoMonad () -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$ Text -> HoYoMonad ()
-forall e (m :: * -> *) a. MonadError e m => e -> m a
-throwError Text
-err
-
--- | Throw an error if a check fails AND the "fail_on_error" flag is set.
-assertVerbose :: T.Text -> HoYoMonad Bool -> HoYoMonad Bool
-assertVerbose :: Text -> HoYoMonad Bool -> HoYoMonad Bool
-assertVerbose Text
-err HoYoMonad Bool
-check = do
-  Bool
-shouldFail <- SimpleGetter Env Bool -> HoYoMonad Bool
-forall a (m :: * -> *) b.
-MonadReader a m =>
-SimpleGetter a b -> m b
-asks' ((Config -> Const r Config) -> Env -> Const r Env
-Lens' Env Config
-config ((Config -> Const r Config) -> Env -> Const r Env)
--> ((Bool -> Const r Bool) -> Config -> Const r Config)
--> (Bool -> Const r Bool)
--> Env
--> Const r Env
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. (Bool -> Const r Bool) -> Config -> Const r Config
-Lens Config Config Bool Bool
-failOnError)
-  Bool
-res <- HoYoMonad Bool
-check
-  Bool -> HoYoMonad () -> HoYoMonad ()
-forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
-when (Bool
-shouldFail Bool -> Bool -> Bool
-&& Bool -> Bool
-not Bool
-res) (HoYoMonad () -> HoYoMonad ()) -> HoYoMonad () -> HoYoMonad ()
-forall a b. (a -> b) -> a -> b
-$ Text -> HoYoMonad ()
-forall e (m :: * -> *) a. MonadError e m => e -> m a
-throwError Text
-err
-  Bool -> HoYoMonad Bool
-forall (m :: * -> *) a. Monad m => a -> m a
-return Bool
-res
-
--- | Given a file name and an extension, try to find a suitable path for
--- backing up that file. Used by 'backupFile'.
-getBackupFile :: (MonadIO m, MonadError T.Text m) => FilePath -> String -> m FilePath
-getBackupFile :: FilePath -> FilePath -> m FilePath
-getBackupFile FilePath
-fp FilePath
-ext = do
-  Bool
-ex <- IO Bool -> m Bool
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
-forall a b. (a -> b) -> a -> b
-$ FilePath -> IO Bool
-doesFileExist FilePath
-fp
-  Bool -> m () -> m ()
-forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
-unless Bool
-ex (m () -> m ()) -> m () -> m ()
-forall a b. (a -> b) -> a -> b
-$ Text -> m ()
-forall e (m :: * -> *) a. MonadError e m => e -> m a
-throwError (Text
-"not a file: " Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> FilePath -> Text
-T.pack FilePath
-fp)
-  let firstTry :: FilePath
-firstTry = FilePath
-fp FilePath -> FilePath -> FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath
-"." FilePath -> FilePath -> FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath
-ext
-  Bool
-firstExists <- IO Bool -> m Bool
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
-forall a b. (a -> b) -> a -> b
-$ FilePath -> IO Bool
-doesFileExist FilePath
-firstTry
-  if Bool
-firstExists
-  then FilePath -> Int -> m FilePath
-forall (m :: * -> *).
-(MonadIO m, MonadError Text m) =>
-FilePath -> Int -> m FilePath
-getBackupFile' FilePath
-fp Int
-2
-  else FilePath -> m FilePath
-forall (m :: * -> *) a. Monad m => a -> m a
-return FilePath
-firstTry
-
-  where
-    getBackupFile' :: (MonadIO m, MonadError T.Text m) => String -> Int -> m String
-    getBackupFile' :: FilePath -> Int -> m FilePath
-getBackupFile' FilePath
-file' Int
-n = do
-      let file :: FilePath
-file = FilePath
-file' FilePath -> FilePath -> FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath
-"." FilePath -> FilePath -> FilePath
-forall a. Semigroup a => a -> a -> a
-<> Int -> FilePath
-forall a. Show a => a -> FilePath
-show Int
-n FilePath -> FilePath -> FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath
-ext
-      Bool
-fileExists <- IO Bool -> m Bool
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
-forall a b. (a -> b) -> a -> b
-$ FilePath -> IO Bool
-doesFileExist FilePath
-file
-      if Bool
-fileExists
-      then FilePath -> Int -> m FilePath
-forall (m :: * -> *).
-(MonadIO m, MonadError Text m) =>
-FilePath -> Int -> m FilePath
-getBackupFile' FilePath
-file' (Int
-n Int -> Int -> Int
-forall a. Num a => a -> a -> a
-+ Int
-1)
-      else FilePath -> m FilePath
-forall (m :: * -> *) a. Monad m => a -> m a
-return FilePath
-file
-
--- | Try to back-up a file. Used when the "backup_before_clear" option is set.
-backupFile :: (MonadIO m, MonadError T.Text m) => FilePath -> String -> m ()
-backupFile :: FilePath -> FilePath -> m ()
-backupFile FilePath
-fp FilePath
-ext = do
-  FilePath
-file <- FilePath -> FilePath -> m FilePath
-forall (m :: * -> *).
-(MonadIO m, MonadError Text m) =>
-FilePath -> FilePath -> m FilePath
-getBackupFile FilePath
-fp FilePath
-ext
-  IO () -> m ()
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO () -> m ()) -> IO () -> m ()
-forall a b. (a -> b) -> a -> b
-$ FilePath -> FilePath -> IO ()
-copyFileWithMetadata FilePath
-fp FilePath
-file
-
--- | Try to read a 'Bool'.
-readBool :: MonadError T.Text m => T.Text -> m Bool
-readBool :: Text -> m Bool
-readBool Text
-s = Either Text Bool -> m Bool
-forall e (m :: * -> *) a. MonadError e m => Either e a -> m a
-liftEither (Either Text Bool -> m Bool) -> Either Text Bool -> m Bool
-forall a b. (a -> b) -> a -> b
-$ (FilePath -> Text) -> Either FilePath Bool -> Either Text Bool
-forall (p :: * -> * -> *) a b c.
-Bifunctor p =>
-(a -> b) -> p a c -> p b c
-first FilePath -> Text
-T.pack (
-              FilePath -> Either FilePath Bool
-forall a. Read a => FilePath -> Either FilePath a
-readEither FilePath
-sStr
-                Either FilePath Bool
--> Either FilePath Bool -> Either FilePath Bool
-forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
-<|> (ParseErrorBundle Text Void -> FilePath)
--> Either (ParseErrorBundle Text Void) Bool -> Either FilePath Bool
-forall (p :: * -> * -> *) a b c.
-Bifunctor p =>
-(a -> b) -> p a c -> p b c
-first ParseErrorBundle Text Void -> FilePath
-forall s e.
-(VisualStream s, TraversableStream s, ShowErrorComponent e) =>
-ParseErrorBundle s e -> FilePath
-Toml.errorBundlePretty (Parsec Void Text Bool
--> FilePath -> Text -> Either (ParseErrorBundle Text Void) Bool
-forall e s a.
-Parsec e s a -> FilePath -> s -> Either (ParseErrorBundle s e) a
-Toml.parse (Parsec Void Text Bool
-Toml.boolP Parsec Void Text Bool
--> ParsecT Void Text Identity () -> Parsec Void Text Bool
-forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
-<* ParsecT Void Text Identity ()
-forall e s (m :: * -> *). MonadParsec e s m => m ()
-Toml.eof) FilePath
-"" Text
-s)
-                Either FilePath Bool
--> Either FilePath Bool -> Either FilePath Bool
-forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
-<|> FilePath -> Either FilePath Bool
-forall a b. a -> Either a b
-Left (FilePath
-"Couldn't parse bool: " FilePath -> FilePath -> FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath
-sStr)
-              )
-  where sStr :: FilePath
-sStr = Text -> FilePath
-T.unpack Text
-s
-
--- | Try to read an 'Int'.
-readInt :: MonadError T.Text m => T.Text -> m Int
-readInt :: Text -> m Int
-readInt Text
-s = Either Text Int -> m Int
-forall e (m :: * -> *) a. MonadError e m => Either e a -> m a
-liftEither (Either Text Int -> m Int) -> Either Text Int -> m Int
-forall a b. (a -> b) -> a -> b
-$ (FilePath -> Text) -> Either FilePath Int -> Either Text Int
-forall (p :: * -> * -> *) a b c.
-Bifunctor p =>
-(a -> b) -> p a c -> p b c
-first FilePath -> Text
-T.pack (
-              FilePath -> Either FilePath Int
-forall a. Read a => FilePath -> Either FilePath a
-readEither FilePath
-sStr
-                Either FilePath Int -> Either FilePath Int -> Either FilePath Int
-forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
-<|> (ParseErrorBundle Text Void -> FilePath)
--> (Integer -> Int)
--> Either (ParseErrorBundle Text Void) Integer
--> Either FilePath Int
-forall (p :: * -> * -> *) a b c d.
-Bifunctor p =>
-(a -> b) -> (c -> d) -> p a c -> p b d
-bimap ParseErrorBundle Text Void -> FilePath
-forall s e.
-(VisualStream s, TraversableStream s, ShowErrorComponent e) =>
-ParseErrorBundle s e -> FilePath
-Toml.errorBundlePretty Integer -> Int
-forall a b. (Integral a, Num b) => a -> b
-fromIntegral (Parsec Void Text Integer
--> FilePath -> Text -> Either (ParseErrorBundle Text Void) Integer
-forall e s a.
-Parsec e s a -> FilePath -> s -> Either (ParseErrorBundle s e) a
-Toml.parse (Parsec Void Text Integer
-Toml.integerP Parsec Void Text Integer
--> ParsecT Void Text Identity () -> Parsec Void Text Integer
-forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
-<* ParsecT Void Text Identity ()
-forall e s (m :: * -> *). MonadParsec e s m => m ()
-Toml.eof) FilePath
-"" Text
-s)
-                Either FilePath Int -> Either FilePath Int -> Either FilePath Int
-forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
-<|> FilePath -> Either FilePath Int
-forall a b. a -> Either a b
-Left (FilePath
-"Couldn't parse integer: " FilePath -> FilePath -> FilePath
-forall a. Semigroup a => a -> a -> a
-<> FilePath
-sStr)
-              )
-  where sStr :: FilePath
-sStr = Text -> FilePath
-T.unpack Text
-s
-
--- | Print to stderr.
-printStderr :: MonadIO m => T.Text -> m ()
-printStderr :: Text -> m ()
-printStderr Text
-msg = IO () -> m ()
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO () -> m ()) -> IO () -> m ()
-forall a b. (a -> b) -> a -> b
-$ do
-  Handle -> [SGR] -> IO ()
-hSetSGR Handle
-stderr [ConsoleLayer -> ColorIntensity -> Color -> SGR
-SetColor ConsoleLayer
-Foreground ColorIntensity
-Vivid Color
-Red]
-  Handle -> Text -> IO ()
-T.hPutStrLn Handle
-stderr Text
-msg
-  Handle -> [SGR] -> IO ()
-hSetSGR Handle
-stderr []
-
--- | Print to stdout.
-printStdout :: MonadIO m => T.Text -> m ()
-printStdout :: Text -> m ()
-printStdout = IO () -> m ()
-forall (m :: * -> *) a. MonadIO m => IO a -> m a
-liftIO (IO () -> m ()) -> (Text -> IO ()) -> Text -> m ()
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Text -> IO ()
-T.putStrLn
-
--- | Format a 'Bookmark'. Used for the "list" command and error reporting
--- during other commands.
---
--- @formatBookmark displayTime numberWidth bm@ returns a pretty representation
--- of @bm@, optionally showing the creation time, and padding the index to a
--- certain width.
-formatBookmark :: Bool -> Int -> Bookmark -> T.Text
-formatBookmark :: Bool -> Int -> Bookmark -> Text
-formatBookmark Bool
-shouldDisplayTime Int
-indexWidth (Bookmark FilePath
-dir Int
-idx ZonedTime
-zTime Maybe Text
-mbName) =
-  let num :: Text
-num = Int -> Char -> Text -> Text
-T.justifyRight Int
-indexWidth Char
-' ' (Text -> Text) -> Text -> Text
-forall a b. (a -> b) -> a -> b
-$ Int -> Text
-forall a. Show a => a -> Text
-tshow Int
-idx
-      timeStr :: Text
-timeStr = FilePath -> Text
-T.pack (FilePath -> Text) -> FilePath -> Text
-forall a b. (a -> b) -> a -> b
-$ TimeLocale -> FilePath -> ZonedTime -> FilePath
-forall t. FormatTime t => TimeLocale -> FilePath -> t -> FilePath
-formatTime TimeLocale
-defaultTimeLocale FilePath
-"%D %T" ZonedTime
-zTime
-      d :: Text
-d = case Maybe Text
-mbName of Maybe Text
-Nothing   -> FilePath -> Text
-T.pack FilePath
-dir
-                         Just Text
-name -> FilePath -> Text
-T.pack FilePath
-dir Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-"\t(" Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-name Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-")"
-
-  in if Bool
-shouldDisplayTime
-     then Text
-num Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-". " Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-timeStr Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-"\t" Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-d
-     else Text
-num Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-". " Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-d
-
--- | Format a list of 'Bookmark's. Used for the "list" command and error reporting
--- during other commands
---
--- @formatBookmark displayTime bms@ returns a pretty representation
--- of @bms@, optionally showing the creation time, and padding the indices to
--- line up.
-formatBookmarks :: Bool -> [Bookmark] -> [T.Text]
-formatBookmarks :: Bool -> [Bookmark] -> [Text]
-formatBookmarks Bool
-shouldDisplayTime [Bookmark]
-bms = (Bookmark -> Text) -> [Bookmark] -> [Text]
-forall a b. (a -> b) -> [a] -> [b]
-map (Bool -> Int -> Bookmark -> Text
-formatBookmark Bool
-shouldDisplayTime Int
-indexWidth) [Bookmark]
-bms
-  where
-    indexWidth :: Int
-indexWidth = Int -> [Int] -> Int
-forall a. Ord a => a -> [a] -> a
-maximumDefault Int
-1 ([Int] -> Int) -> [Int] -> Int
-forall a b. (a -> b) -> a -> b
-$ (Bookmark -> Int) -> [Bookmark] -> [Int]
-forall a b. (a -> b) -> [a] -> [b]
-map (FilePath -> Int
-forall (t :: * -> *) a. Foldable t => t a -> Int
-length (FilePath -> Int) -> (Bookmark -> FilePath) -> Bookmark -> Int
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Int -> FilePath
-forall a. Show a => a -> FilePath
-show (Int -> FilePath) -> (Bookmark -> Int) -> Bookmark -> FilePath
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. Getting Int Bookmark Int -> Bookmark -> Int
-forall a s. Getting a s a -> s -> a
-view Getting Int Bookmark Int
-Lens' Bookmark Int
-bookmarkIndex) [Bookmark]
-bms
-
--- | Format a 'DefaultBookmark'. Used for the "config print" command and error reporting
--- during other commands.
---
--- @formatDefaultBookmark bm@ returns a pretty representation of @bm@.
-formatDefaultBookmark :: DefaultBookmark -> T.Text
-formatDefaultBookmark :: DefaultBookmark -> Text
-formatDefaultBookmark (DefaultBookmark FilePath
-dir Maybe Text
-mbName) =
-  case Maybe Text
-mbName of Maybe Text
-Nothing   -> FilePath -> Text
-T.pack FilePath
-dir
-                 Just Text
-name -> FilePath -> Text
-T.pack FilePath
-dir Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-"\t(" Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-name Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-")"
-
--- | Show a value as a 'T.Text' instead of a 'String'.
-tshow :: Show a => a -> T.Text
-tshow :: a -> Text
-tshow = FilePath -> Text
-T.pack (FilePath -> Text) -> (a -> FilePath) -> a -> Text
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. a -> FilePath
-forall a. Show a => a -> FilePath
-show
-
--- | Format a config value. Used for the "config print" command.
-formatConfigValue :: AnyConfigValue -> T.Text
-formatConfigValue :: AnyConfigValue -> Text
-formatConfigValue (AnyConfigValue (BoolV Bool
-bool)) = Bool -> Text
-forall a. Show a => a -> Text
-tshow Bool
-bool
-formatConfigValue (AnyConfigValue (DefaultBookmarkV DefaultBookmark
-bm)) = DefaultBookmark -> Text
-formatDefaultBookmark DefaultBookmark
-bm
-formatConfigValue (AnyConfigValue (CommandV Command
-t)) = Text -> Text
-forall a. Show a => a -> Text
-tshow (Text -> Text) -> Text -> Text
-forall a b. (a -> b) -> a -> b
-$ [Text] -> Text
-formatArgs ([Text] -> Text) -> [Text] -> Text
-forall a b. (a -> b) -> a -> b
-$ Command -> [Text]
-formatCommand Command
-t
--- formatConfigValue (AnyConfigValue (CommandV t)) = tshow t
-formatConfigValue (AnyConfigValue (MaybeV Maybe (ConfigValue a)
-t)) = case Maybe (ConfigValue a)
-t of
-                                                  Maybe (ConfigValue a)
-Nothing -> Text
-""
-                                                  Just ConfigValue a
-t' -> AnyConfigValue -> Text
-formatConfigValue (ConfigValue a -> AnyConfigValue
-forall (t :: ConfigValueType). ConfigValue t -> AnyConfigValue
-AnyConfigValue ConfigValue a
-t')
-formatConfigValue (AnyConfigValue (ListOfV [ConfigValue a]
-xs)) = Text -> [Text] -> Text
-T.intercalate Text
-"\n" ([Text
-"["] [Text] -> [Text] -> [Text]
-forall a. Semigroup a => a -> a -> a
-<> (ConfigValue a -> Text) -> [ConfigValue a] -> [Text]
-forall a b. (a -> b) -> [a] -> [b]
-map ((Text
-"  " Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<>) (Text -> Text) -> (ConfigValue a -> Text) -> ConfigValue a -> Text
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. AnyConfigValue -> Text
-formatConfigValue (AnyConfigValue -> Text)
--> (ConfigValue a -> AnyConfigValue) -> ConfigValue a -> Text
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. ConfigValue a -> AnyConfigValue
-forall (t :: ConfigValueType). ConfigValue t -> AnyConfigValue
-AnyConfigValue) [ConfigValue a]
-xs [Text] -> [Text] -> [Text]
-forall a. Semigroup a => a -> a -> a
-<> [Text
-"]"])
-
-formatBookmarkSearchTerm :: BookmarkSearchTerm -> T.Text
-formatBookmarkSearchTerm :: BookmarkSearchTerm -> Text
-formatBookmarkSearchTerm (SearchIndex Int
-idx) = Text
-"#" Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Int -> Text
-forall a. Show a => a -> Text
-tshow Int
-idx
-formatBookmarkSearchTerm (SearchName Text
-name) = Text
-name
-
-formatSearchTerm :: BookmarkSearchTerm -> T.Text
-formatSearchTerm :: BookmarkSearchTerm -> Text
-formatSearchTerm (SearchIndex Int
-idx) = Int -> Text
-forall a. Show a => a -> Text
-tshow Int
-idx
-formatSearchTerm (SearchName Text
-name) = Text
-name
-
-singleton :: T.Text -> [T.Text]
-singleton :: Text -> [Text]
-singleton Text
-t = [Text
-t]
-
-maybeSingleton :: Maybe T.Text -> [T.Text]
-maybeSingleton :: Maybe Text -> [Text]
-maybeSingleton = [Text] -> (Text -> [Text]) -> Maybe Text -> [Text]
-forall b a. b -> (a -> b) -> Maybe a -> b
-maybe [] Text -> [Text]
-singleton
-
-maybeSingletonWithPrefix :: [T.Text] -> Maybe T.Text -> [T.Text]
-maybeSingletonWithPrefix :: [Text] -> Maybe Text -> [Text]
-maybeSingletonWithPrefix [Text]
-pref = [Text] -> (Text -> [Text]) -> Maybe Text -> [Text]
-forall b a. b -> (a -> b) -> Maybe a -> b
-maybe [] (\Text
-t -> [Text]
-pref [Text] -> [Text] -> [Text]
-forall a. Semigroup a => a -> a -> a
-<> [Text
-t])
-
-formatCommand :: Command -> [T.Text]
-formatCommand :: Command -> [Text]
-formatCommand (Add (AddOptions FilePath
-d Maybe Text
-n)) = Text
-"add" Text -> [Text] -> [Text]
-forall a. a -> [a] -> [a]
-: FilePath -> Text
-T.pack FilePath
-d Text -> [Text] -> [Text]
-forall a. a -> [a] -> [a]
-: Maybe Text -> [Text]
-maybeSingleton Maybe Text
-n
-formatCommand (Move MoveOptions
-opts) = [Text
-"move", BookmarkSearchTerm -> Text
-formatSearchTerm (BookmarkSearchTerm -> Text) -> BookmarkSearchTerm -> Text
-forall a b. (a -> b) -> a -> b
-$ MoveOptions -> BookmarkSearchTerm
-moveSearch MoveOptions
-opts]
-formatCommand (List (ListOptions Maybe Text
-n Maybe Text
-d)) = [Text
-"list"]
-                                      [Text] -> [Text] -> [Text]
-forall a. Semigroup a => a -> a -> a
-<> [Text] -> Maybe Text -> [Text]
-maybeSingletonWithPrefix [Text
-"--name"] Maybe Text
-n
-                                      [Text] -> [Text] -> [Text]
-forall a. Semigroup a => a -> a -> a
-<> [Text] -> Maybe Text -> [Text]
-maybeSingletonWithPrefix [Text
-"--dir"] Maybe Text
-d
-formatCommand (Clear ClearOptions
-ClearOptions) = [Text
-"clear"]
-formatCommand (Delete DeleteOptions
-opts) = [Text
-"delete", BookmarkSearchTerm -> Text
-formatSearchTerm (BookmarkSearchTerm -> Text) -> BookmarkSearchTerm -> Text
-forall a b. (a -> b) -> a -> b
-$ DeleteOptions -> BookmarkSearchTerm
-deleteSearch DeleteOptions
-opts]
-formatCommand (Refresh RefreshOptions
-RefreshOptions) = [Text
-"refresh"]
-formatCommand (ConfigCmd ConfigCommand
-cmd) = Text
-"config" Text -> [Text] -> [Text]
-forall a. a -> [a] -> [a]
-: ConfigCommand -> [Text]
-formatConfigCommand ConfigCommand
-cmd
-formatCommand (Check (CheckOptions Bool
-c Bool
-b)) = [Text
-"check"]
-                                        [Text] -> [Text] -> [Text]
-forall a. Semigroup a => a -> a -> a
-<> (if Bool
-c then [Text
-"--config"] else [])
-                                        [Text] -> [Text] -> [Text]
-forall a. Semigroup a => a -> a -> a
-<> (if Bool
-b then [Text
-"--bookmarks"] else [])
-formatCommand (Help (HelpOptions Maybe Text
-cmd)) = [Text
-"help"] [Text] -> [Text] -> [Text]
-forall a. Semigroup a => a -> a -> a
-<> Maybe Text -> [Text]
-forall a. Maybe a -> [a]
-maybeToList Maybe Text
-cmd
-formatCommand Command
-DefaultCommand = []
-
-formatConfigCommand :: ConfigCommand -> [T.Text]
-formatConfigCommand :: ConfigCommand -> [Text]
-formatConfigCommand (Print ConfigPrintOptions
-ConfigPrintOptions) = [Text
-"print"]
-formatConfigCommand (Reset ConfigResetOptions
-ConfigResetOptions) = [Text
-"reset"]
-formatConfigCommand (Set ConfigSetOptions
-opts) = [Text
-"set"
-                                , ConfigSetOptions -> Text
-setKey ConfigSetOptions
-opts
-                                , ConfigSetOptions -> Text
-setValue ConfigSetOptions
-opts
-                                ]
-formatConfigCommand (AddDefaultBookmark (ConfigAddDefaultOptions FilePath
-d Maybe Text
-n))
-  = Text
-"add-default" Text -> [Text] -> [Text]
-forall a. a -> [a] -> [a]
-: FilePath -> Text
-T.pack FilePath
-d Text -> [Text] -> [Text]
-forall a. a -> [a] -> [a]
-: Maybe Text -> [Text]
-maybeSingleton Maybe Text
-n
-
-formatGlobals :: GlobalOptions -> [T.Text]
-formatGlobals :: GlobalOptions -> [Text]
-formatGlobals (GlobalOptions Maybe FilePath
-c Maybe FilePath
-d OverrideOptions
-o) = [Text] -> Maybe Text -> [Text]
-maybeSingletonWithPrefix [Text
-"--config-file"] (FilePath -> Text
-T.pack (FilePath -> Text) -> Maybe FilePath -> Maybe Text
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Maybe FilePath
-c)
-                                   [Text] -> [Text] -> [Text]
-forall a. Semigroup a => a -> a -> a
-<> [Text] -> Maybe Text -> [Text]
-maybeSingletonWithPrefix [Text
-"--bookmarks-file"] (FilePath -> Text
-T.pack (FilePath -> Text) -> Maybe FilePath -> Maybe Text
-forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
-<$> Maybe FilePath
-d)
-                                   [Text] -> [Text] -> [Text]
-forall a. Semigroup a => a -> a -> a
-<> OverrideOptions -> [Text]
-formatOverrides OverrideOptions
-o
-
-formatOverrides :: OverrideOptions -> [T.Text]
-formatOverrides :: OverrideOptions -> [Text]
-formatOverrides (OverrideOptions MaybeOverride
-f MaybeOverride
-t MaybeOverride
-c MaybeOverride
-r MaybeOverride
-b) = Text -> Text -> MaybeOverride -> [Text]
-formatOverride Text
-"fail" Text
-"nofail" MaybeOverride
-f
-                                           [Text] -> [Text] -> [Text]
-forall a. Semigroup a => a -> a -> a
-<> Text -> Text -> MaybeOverride -> [Text]
-formatOverride Text
-"time" Text
-"notime" MaybeOverride
-t
-                                           [Text] -> [Text] -> [Text]
-forall a. Semigroup a => a -> a -> a
-<> Text -> Text -> MaybeOverride -> [Text]
-formatOverride Text
-"enable-clear" Text
-"disable-clear" MaybeOverride
-c
-                                           [Text] -> [Text] -> [Text]
-forall a. Semigroup a => a -> a -> a
-<> Text -> Text -> MaybeOverride -> [Text]
-formatOverride Text
-"enable-reset" Text
-"disable-reset" MaybeOverride
-r
-                                           [Text] -> [Text] -> [Text]
-forall a. Semigroup a => a -> a -> a
-<> Text -> Text -> MaybeOverride -> [Text]
-formatOverride Text
-"backup-before-clear" Text
-"no-backup-before-clear" MaybeOverride
-b
-
-formatOverride :: T.Text -> T.Text -> MaybeOverride -> [T.Text]
-formatOverride :: Text -> Text -> MaybeOverride -> [Text]
-formatOverride Text
-_ Text
-no MaybeOverride
-OverrideFalse = [Text
-"--" Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-no]
-formatOverride Text
-yes Text
-_ MaybeOverride
-OverrideTrue = [Text
-"--" Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-yes]
-formatOverride Text
-_ Text
-_ MaybeOverride
-NoOverride     = []
-formatOverride Text
-yes Text
-no MaybeOverride
-Conflict    = [Text
-"--" Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-no, Text
-"--" Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-yes]
-
-formatOptions :: Options -> [T.Text]
-formatOptions :: Options -> [Text]
-formatOptions (Options Command
-c GlobalOptions
-g) = Command -> [Text]
-formatCommand Command
-c [Text] -> [Text] -> [Text]
-forall a. Semigroup a => a -> a -> a
-<> GlobalOptions -> [Text]
-formatGlobals GlobalOptions
-g
-
-formatArgs :: [T.Text] -> T.Text
-formatArgs :: [Text] -> Text
-formatArgs = [Text] -> Text
-T.unwords ([Text] -> Text) -> ([Text] -> [Text]) -> [Text] -> Text
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. (Text -> Text) -> [Text] -> [Text]
-forall a b. (a -> b) -> [a] -> [b]
-map Text -> Text
-quoteStrings
-  where quoteStrings :: T.Text -> T.Text
-        quoteStrings :: Text -> Text
-quoteStrings Text
-s | Char
-' ' Char -> FilePath -> Bool
-forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
-`elem` Text -> FilePath
-T.unpack Text
-s = Text
-"\"" Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-s Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-"\"" | Bool
-otherwise  = Text
-s
-
\ No newline at end of file diff --git a/docs/src/HoYo.Internal.Version.html b/docs/src/HoYo.Internal.Version.html deleted file mode 100644 index 1a4c7ce..0000000 --- a/docs/src/HoYo.Internal.Version.html +++ /dev/null @@ -1,22 +0,0 @@ -
{-|
-Module      : HoYo.Internal.Version
-Copyright   : (c) Frederick Pringle, 2023
-License     : BSD-3-Clause
-Maintainer  : freddyjepringle@gmail.com
-
-This module just exports a string containing the current HoYo version.
--}
-
-{-# LANGUAGE TemplateHaskell #-}
-
-module HoYo.Internal.Version (
-  versionString
-  ) where
-
-import Data.Version.Package
-
--- | The current @hoyo@ version.
-versionString :: String
-versionString :: String
-versionString = $$(packageVersionStringTH "hoyo.cabal")
-
\ No newline at end of file diff --git a/docs/src/HoYo.html b/docs/src/HoYo.html deleted file mode 100644 index 98c8448..0000000 --- a/docs/src/HoYo.html +++ /dev/null @@ -1,204 +0,0 @@ -
{-|
-Module      : HoYo
-Copyright   : (c) Frederick Pringle, 2023
-License     : BSD-3-Clause
-Maintainer  : freddyjepringle@gmail.com
-
-hoyo is a command-line utility that lets the user save directories
-as bookmarks (similar to in the browser) and easily @cd@ to them.
--}
-
-module HoYo (
-  -- * Bookmarks
-  Bookmark (..)
-  , Bookmarks (..)
-  , searchBookmarks
-  , filterBookmarks
-  , module HoYo.Bookmark
-
-  -- * Config
-  , Config (..)
-  , defaultConfig
-  , setConfig
-  , module HoYo.Config
-  , module HoYo.Env
-
-  -- * CLI commands
-  , Command
-  , runCommand
-  , module HoYo.Command
-
-  -- * Utility functions
-  , runHoYo
-  , withFiles
-  , getEnvAndRunHoYo
-  , getEnvAndRunCommand
-  , HoYoMonad
-  , modifyBookmarks
-  , modifyBookmarksM
-  , printStderr
-  , printStdout
-  , readInt
-  , readBool
-  , backupFile
-  , assert
-  , assertVerbose
-
-  -- * Misc
-  , versionString
-  ) where
-
-import           Control.Monad.Except       (runExceptT)
-import           Control.Monad.Trans.Reader (runReaderT)
-
-import qualified Data.Text                  as T
-
-import           HoYo.Bookmark
-import           HoYo.Command
-import           HoYo.Config
-import           HoYo.Env
-import           HoYo.Internal.Types
-import           HoYo.Internal.Utils
-import           HoYo.Internal.Version
-
-import           System.Exit
-
--- | Given a hoyo 'Env', run a monadic action in IO.
-runHoYo :: HoYoMonad a -> Env -> IO (Either T.Text a)
-runHoYo :: HoYoMonad a -> Env -> IO (Either Text a)
-runHoYo = ReaderT Env IO (Either Text a) -> Env -> IO (Either Text a)
-forall r (m :: * -> *) a. ReaderT r m a -> r -> m a
-runReaderT (ReaderT Env IO (Either Text a) -> Env -> IO (Either Text a))
--> (HoYoMonad a -> ReaderT Env IO (Either Text a))
--> HoYoMonad a
--> Env
--> IO (Either Text a)
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. ExceptT Text (ReaderT Env IO) a -> ReaderT Env IO (Either Text a)
-forall e (m :: * -> *) a. ExceptT e m a -> m (Either e a)
-runExceptT (ExceptT Text (ReaderT Env IO) a -> ReaderT Env IO (Either Text a))
--> (HoYoMonad a -> ExceptT Text (ReaderT Env IO) a)
--> HoYoMonad a
--> ReaderT Env IO (Either Text a)
-forall b c a. (b -> c) -> (a -> b) -> a -> c
-. HoYoMonad a -> ExceptT Text (ReaderT Env IO) a
-forall a. HoYoMonad a -> ExceptT Text (ReaderT Env IO) a
-unHoYo
-
-failure :: T.Text -> IO a
-failure :: Text -> IO a
-failure Text
-err = do
-  Text -> IO ()
-forall (m :: * -> *). MonadIO m => Text -> m ()
-printStderr (Text
-"Error: " Text -> Text -> Text
-forall a. Semigroup a => a -> a -> a
-<> Text
-err)
-  ExitCode -> IO a
-forall a. ExitCode -> IO a
-exitWith (Int -> ExitCode
-ExitFailure Int
-1)
-
--- | @withFiles globals bFp sFp hoyo@ gets the environment saved in
--- the bookmark path (@bFp@) and the config path (@sFp@), applies the global
--- options and overrides in @globals@, and runs @hoyo@, returning either
--- the result or an error message.
-withFiles :: GlobalOptions -> FilePath -> FilePath -> HoYoMonad a -> IO (Either T.Text a)
-withFiles :: GlobalOptions
--> FilePath -> FilePath -> HoYoMonad a -> IO (Either Text a)
-withFiles GlobalOptions
-globals FilePath
-bFp FilePath
-sFp HoYoMonad a
-hoyo =
-  FilePath -> FilePath -> IO (Either Text Env)
-forall (m :: * -> *).
-MonadIO m =>
-FilePath -> FilePath -> m (Either Text Env)
-getEnv FilePath
-bFp FilePath
-sFp IO (Either Text Env)
--> (Either Text Env -> IO (Either Text a)) -> IO (Either Text a)
-forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
->>= \case
-    Left Text
-err  -> Text -> IO (Either Text a)
-forall a. Text -> IO a
-failure Text
-err
-    Right Env
-env -> HoYoMonad a -> Env -> IO (Either Text a)
-forall a. HoYoMonad a -> Env -> IO (Either Text a)
-runHoYo HoYoMonad a
-hoyo (Env -> IO (Either Text a)) -> Env -> IO (Either Text a)
-forall a b. (a -> b) -> a -> b
-$ OverrideOptions -> Env -> Env
-overrideEnv (GlobalOptions -> OverrideOptions
-overrides GlobalOptions
-globals) Env
-env
-
--- | @getEnvAndRunHoYo globals hoyo bFp sFp@ gets the environment saved in
--- the bookmark path (@bFp@) and the config path (@sFp@), applies the global
--- options and overrides in @globals@, and runs @hoyo@, either printing an error
--- message or discarding the result.
-getEnvAndRunHoYo :: GlobalOptions -> HoYoMonad a -> FilePath -> FilePath -> IO a
-getEnvAndRunHoYo :: GlobalOptions -> HoYoMonad a -> FilePath -> FilePath -> IO a
-getEnvAndRunHoYo GlobalOptions
-globals HoYoMonad a
-hoyo FilePath
-bFp FilePath
-sFp = GlobalOptions
--> FilePath -> FilePath -> HoYoMonad a -> IO (Either Text a)
-forall a.
-GlobalOptions
--> FilePath -> FilePath -> HoYoMonad a -> IO (Either Text a)
-withFiles GlobalOptions
-globals FilePath
-bFp FilePath
-sFp HoYoMonad a
-hoyo IO (Either Text a) -> (Either Text a -> IO a) -> IO a
-forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
->>= \case
-  Left Text
-err  -> Text -> IO a
-forall a. Text -> IO a
-failure Text
-err
-  Right a
-res -> a -> IO a
-forall (m :: * -> *) a. Monad m => a -> m a
-return a
-res
-
--- | @getEnvAndRunHoYo opts bFp sFp@ gets the environment saved in
--- the bookmark path (@bFp@) and the config path (@sFp@), and runs the command
--- specified by @opts@.
-getEnvAndRunCommand :: Options -> FilePath -> FilePath -> IO ()
-getEnvAndRunCommand :: Options -> FilePath -> FilePath -> IO ()
-getEnvAndRunCommand (Options Command
-cmd GlobalOptions
-globals) FilePath
-bFp FilePath
-sFp = case Command
-cmd of
-  Check CheckOptions
-opts -> CheckOptions -> FilePath -> FilePath -> IO ()
-runCheck CheckOptions
-opts FilePath
-bFp FilePath
-sFp
-  Command
-otherCmd   -> GlobalOptions -> HoYoMonad () -> FilePath -> FilePath -> IO ()
-forall a.
-GlobalOptions -> HoYoMonad a -> FilePath -> FilePath -> IO a
-getEnvAndRunHoYo GlobalOptions
-globals (Command -> HoYoMonad ()
-runCommand Command
-otherCmd) FilePath
-bFp FilePath
-sFp
-
\ No newline at end of file diff --git a/hoyo.cabal b/hoyo.cabal index b088217..8da81f3 100644 --- a/hoyo.cabal +++ b/hoyo.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: hoyo -version: 0.4.0.0 +version: 0.5.0.0 license: BSD-3-Clause license-file: LICENSE maintainer: freddyjepringle@gmail.com