| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Hledger.Cli.Commands.Run
Description
The run command allows you to run multiple commands via REPL or from the supplied file(s).
Synopsis
- runmode :: Mode RawOpts
- run :: Maybe DefaultRunJournal -> (String -> Maybe (Mode RawOpts, CliOpts -> Journal -> IO ())) -> [String] -> [(CommandAlias, CommandLine)] -> Bool -> CliOpts -> IO ()
- replmode :: Mode RawOpts
- repl :: (String -> Maybe (Mode RawOpts, CliOpts -> Journal -> IO ())) -> [String] -> [(CommandAlias, CommandLine)] -> Bool -> Maybe (FilePath, RawOpts) -> Maybe (IO [String]) -> CliOpts -> IO ()
- runOrReplStub :: CliOpts -> Journal -> IO ()
Documentation
run :: Maybe DefaultRunJournal -> (String -> Maybe (Mode RawOpts, CliOpts -> Journal -> IO ())) -> [String] -> [(CommandAlias, CommandLine)] -> Bool -> CliOpts -> IO () Source #
The actual run command.
repl :: (String -> Maybe (Mode RawOpts, CliOpts -> Journal -> IO ())) -> [String] -> [(CommandAlias, CommandLine)] -> Bool -> Maybe (FilePath, RawOpts) -> Maybe (IO [String]) -> CliOpts -> IO () Source #
The actual repl command. mconfinfo is the active config file and the raw options needed to re-read it, used to auto-reload command aliases when the config file changes. mrescanAddons is an action that re-scans PATH for addon commands, used to auto-reload the addon command list when PATH's contents change.
runOrReplStub :: CliOpts -> Journal -> IO () Source #
The fake run/repl command introduced to break circular dependency.
This module needs access to findBuiltinCommand, which is defined in Hledger.Cli.Commands
However, Hledger.Cli.Commands imports this module, which creates circular dependency.
We expose this do-nothing function so that it could be included in the list of all commands inside
Hledger.Cli.Commands and ensure that "run" is recognized as a valid command by the Hledger.Cli top-level
command line parser. That parser, however, would not call run'. It has a special case for "run", and
will call "run" (see below), passing it findBuiltinCommand, thus breaking circular dependency.