hledger-1.43.1: Command-line interface for the hledger accounting system
Safe HaskellNone
LanguageHaskell2010

Hledger.Cli.Commands.Run

Description

The run command allows you to run multiple commands via REPL or from the supplied file(s).

Synopsis

Documentation

runmode :: Mode RawOpts Source #

Command line options for this command.

run :: Maybe DefaultRunJournal -> (String -> Maybe (Mode RawOpts, CliOpts -> Journal -> IO ())) -> [String] -> CliOpts -> IO () Source #

The actual run command.

repl :: (String -> Maybe (Mode RawOpts, CliOpts -> Journal -> IO ())) -> [String] -> CliOpts -> IO () Source #

The actual repl command.

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.