-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | The main command-line interface for the hledger accounting tool.
--   
--   hledger is a library and set of user tools for working with financial
--   data (or anything that can be tracked in a double-entry accounting
--   ledger.) It is a haskell port and friendly fork of John Wiegley's
--   Ledger. hledger provides command-line, curses and web interfaces, and
--   aims to be a reliable, practical tool for daily use.
@package hledger
@version 0.22

module Hledger.Cli.Version
progname :: String
version :: String
prognameandversion :: String

-- | Given a program name, return a precise platform-specific executable
--   name suitable for naming downloadable binaries. Can raise an error if
--   the version and patch level was not defined correctly at build time.
binaryfilename :: String -> String


-- | Command-line options for the hledger program, and related utilities.
module Hledger.Cli.Options

-- | The top-level cmdargs mode for hledger.
mainmode :: [Name] -> Mode RawOpts
activitymode :: Mode RawOpts
addmode :: Mode RawOpts
balancemode :: Mode RawOpts
balancesheetmode :: Mode RawOpts
cashflowmode :: Mode RawOpts
incomestatementmode :: Mode RawOpts
printmode :: Mode RawOpts
registermode :: Mode RawOpts
statsmode :: Mode RawOpts
testmode :: Mode RawOpts
convertmode :: Mode RawOpts

-- | A basic subcommand mode with the given command name(s).
defCommandMode :: [Name] -> Mode RawOpts
argsFlag :: FlagHelp -> Arg [([Char], [Char])]

-- | Common help flags: --help, --debug, --version...
helpflags :: [Flag [([Char], [Char])]]

-- | Common input-related flags: --file, --rules-file, --alias...
inputflags :: [Flag [([Char], [Char])]]

-- | Common report-related flags: --period, --cost, --display etc.
reportflags :: [Flag [([Char], [Char])]]
generalflagsgroup1 :: ([Char], [Flag [([Char], [Char])]])
generalflagsgroup2 :: ([Char], [Flag [([Char], [Char])]])
generalflagsgroup3 :: ([Char], [Flag [([Char], [Char])]])

-- | Our cmdargs modes parse arguments into an association list for better
--   reuse.
type RawOpts = [(String, String)]

-- | Is the named option present ?
inRawOpts :: String -> RawOpts -> Bool
boolopt :: String -> RawOpts -> Bool
intopt :: String -> RawOpts -> Int
maybeintopt :: String -> RawOpts -> Maybe Int
stringopt :: Eq a => a -> [(a, String)] -> [Char]
maybestringopt :: Eq a => a -> [(a, String)] -> Maybe String
listofstringopt :: Eq a => a -> [(a, t)] -> [t]
setopt :: t -> [Char] -> [(t, [Char])] -> [(t, [Char])]
setboolopt :: t -> [(t, [Char])] -> [(t, [Char])]

-- | Command line options. Used in the <tt>hledger</tt> package and above.
data CliOpts
CliOpts :: RawOpts -> String -> Maybe FilePath -> Maybe FilePath -> [String] -> Int -> Bool -> Maybe String -> ReportOpts -> CliOpts
rawopts_ :: CliOpts -> RawOpts
command_ :: CliOpts -> String
file_ :: CliOpts -> Maybe FilePath
rules_file_ :: CliOpts -> Maybe FilePath
alias_ :: CliOpts -> [String]

-- | debug level, set by <tt>--debug[=N]</tt>. See also <a>debugLevel</a>.
debug_ :: CliOpts -> Int
no_new_accounts_ :: CliOpts -> Bool
width_ :: CliOpts -> Maybe String
reportopts_ :: CliOpts -> ReportOpts
defcliopts :: CliOpts

-- | Get the account name aliases from options, if any.
aliasesFromOpts :: CliOpts -> [(AccountName, AccountName)]

-- | Parse the format option if provided, possibly returning an error,
--   otherwise get the default value.
formatFromOpts :: ReportOpts -> Either String [FormatString]

-- | Get the (tilde-expanded, absolute) journal file path from 1. options,
--   2. an environment variable, or 3. the default.
journalFilePathFromOpts :: CliOpts -> IO String

-- | Get the (tilde-expanded) rules file path from options, if any.
rulesFilePathFromOpts :: CliOpts -> IO (Maybe FilePath)

-- | Output width configuration (for register).
data OutputWidth

-- | specify the overall width
TotalWidth :: Width -> OutputWidth

-- | specify each field's width
FieldWidths :: [Width] -> OutputWidth

-- | A width value.
data Width

-- | set width to exactly this number of characters
Width :: Int -> Width

-- | set width automatically from available space
Auto :: Width

-- | Default width of hledger console output.
defaultWidth :: Int

-- | Width of hledger console output when the -w flag is used with no
--   value.
defaultWidthWithFlag :: Int

-- | Parse the width option if provided, possibly returning an error,
--   otherwise get the default value.
widthFromOpts :: CliOpts -> Either String OutputWidth

-- | Get the unique suffixes (without hledger-) of hledger-* executables
--   found in the current user's PATH, or the empty list if there is any
--   problem.
getHledgerAddonCommands :: IO [String]

-- | Parse hledger CLI options from these command line arguments and add-on
--   command names, or raise any error.
argsToCliOpts :: [String] -> [String] -> IO CliOpts

-- | A hacky workaround for cmdargs not accepting flags before the
--   subcommand name: try to detect and move such flags after the command.
--   This allows the user to put them in either position. The order of
--   options is not preserved, but this should be ok.
--   
--   Since we're not parsing flags as precisely as cmdargs here, this is
--   imperfect. We make a decent effort to: - move all no-argument help and
--   input flags - move all required-argument help and input flags along
--   with their values, space-separated or not - not confuse things further
--   or cause misleading errors.
moveFlagsAfterCommand :: [String] -> [String]

-- | Convert possibly encoded option values to regular unicode strings.
decodeRawOpts :: [(t, SystemString)] -> [(t, String)]

-- | Do final validation of processed opts, raising an error if there is
--   trouble.
checkCliOpts :: CliOpts -> IO CliOpts

-- | Parse raw option string values to the desired final data types. Any
--   relative smart dates will be converted to fixed dates based on today's
--   date. Parsing failures will raise an error.
rawOptsToCliOpts :: RawOpts -> IO CliOpts

-- | Raise an error, showing the specified message plus a hint about
--   --help.
optserror :: [Char] -> c

-- | Get a mode's help message as a nicely wrapped string.
showModeHelp :: Mode a -> String

-- | Print debug info about arguments and options if --debug is present.
debugArgs :: [String] -> CliOpts -> IO ()

-- | Parse hledger CLI options from the command line using the given
--   cmdargs mode, and either return them or, if a help flag is present,
--   print the mode help and exit the program.
getCliOpts :: Mode RawOpts -> IO CliOpts
tests_Hledger_Cli_Options :: Test
instance Typeable CliOpts
instance Show CliOpts
instance Data CliOpts
instance Show Width
instance Show OutputWidth
instance Default CliOpts


-- | A ledger-compatible <tt>balance</tt> command, with additional support
--   for multi-column reports.
--   
--   Here is a description/specification for the balance command. See also
--   <a>Hledger.Reports</a> -&gt; "Balance reports".
--   
--   <i>Basic balance report</i>
--   
--   With no reporting interval (<tt>--monthly</tt> etc.), hledger's
--   balance command emulates ledger's, showing accounts indented according
--   to hierarchy, along with their total amount posted (including
--   subaccounts).
--   
--   Here's an example. With <tt>data/sample.journal</tt>, which defines
--   the following account tree:
--   
--   <pre>
--   assets
--     bank
--       checking
--       saving
--     cash
--   expenses
--     food
--     supplies
--   income
--     gifts
--     salary
--   liabilities
--     debts
--   </pre>
--   
--   the basic <tt>balance</tt> command gives this output:
--   
--   <pre>
--    $ hledger -f sample.journal balance
--                    $-1  assets
--                     $1    bank:saving
--                    $-2    cash
--                     $2  expenses
--                     $1    food
--                     $1    supplies
--                    $-2  income
--                    $-1    gifts
--                    $-1    salary
--                     $1  liabilities:debts
--   --------------------
--                      0
--   </pre>
--   
--   Subaccounts are displayed indented below their parent. Only the
--   account leaf name (the final part) is shown. (With <tt>--flat</tt>,
--   account names are shown in full and unindented.)
--   
--   Each account's "balance" is the sum of postings in that account and
--   any subaccounts during the report period. When the report period
--   includes all transactions, this is equivalent to the account's current
--   balance.
--   
--   The overall total of the highest-level displayed accounts is shown
--   below the line. (The <tt>--no-total/-N</tt> flag prevents this.)
--   
--   <i>Eliding and omitting</i>
--   
--   Accounts which have a zero balance, and no non-zero subaccount
--   balances, are normally omitted from the report. (The
--   <tt>--empty/-E</tt> flag forces such accounts to be displayed.) Eg,
--   above <tt>checking</tt> is omitted because it has a zero balance and
--   no subaccounts.
--   
--   Accounts which have a single subaccount also being displayed, with the
--   same balance, are normally elided into the subaccount's line. (The
--   <tt>--no-elide</tt> flag prevents this.) Eg, above <tt>bank</tt> is
--   elided to <tt>bank:saving</tt> because it has only a single displayed
--   subaccount (<tt>saving</tt>) and their balance is the same ($1).
--   Similarly, <tt>liabilities</tt> is elided to
--   <tt>liabilities:debts</tt>.
--   
--   <i>Date limiting</i>
--   
--   The default report period is that of the whole journal, including all
--   known transactions. The <tt>--begin/-b</tt>, <tt>--end/-e</tt>,
--   <tt>--period/-p</tt> options or <tt>date:</tt>/<tt>date2:</tt>
--   patterns can be used to report only on transactions before and/or
--   after specified dates.
--   
--   <i>Depth limiting</i>
--   
--   The <tt>--depth</tt> option can be used to limit the depth of the
--   balance report. Eg, to see just the top level accounts (still
--   including their subaccount balances):
--   
--   <pre>
--   $ hledger -f sample.journal balance --depth 1
--                    $-1  assets
--                     $2  expenses
--                    $-2  income
--                     $1  liabilities
--   --------------------
--                      0
--   </pre>
--   
--   <i>Account limiting</i>
--   
--   With one or more account pattern arguments, the report is restricted
--   to accounts whose name matches one of the patterns, plus their parents
--   and subaccounts. Eg, adding the pattern <tt>o</tt> to the first
--   example gives:
--   
--   <pre>
--    $ hledger -f sample.journal balance o
--                     $1  expenses:food
--                    $-2  income
--                    $-1    gifts
--                    $-1    salary
--   --------------------
--                    $-1
--   </pre>
--   
--   <ul>
--   <li>The <tt>o</tt> pattern matched <tt>food</tt> and <tt>income</tt>,
--   so they are shown.</li>
--   <li><tt>food</tt>'s parent (<tt>expenses</tt>) is shown even though
--   the pattern didn't match it, to clarify the hierarchy. The usual
--   eliding rules cause it to be elided here.</li>
--   <li><tt>income</tt>'s subaccounts are also shown.</li>
--   </ul>
--   
--   <i>Multi-column balance report</i>
--   
--   hledger's balance command will show multiple columns when a reporting
--   interval is specified (eg with <tt>--monthly</tt>), one column for
--   each sub-period.
--   
--   There are three kinds of multi-column balance report, indicated by the
--   heading:
--   
--   <ul>
--   <li>A "period balance" (or "flow") report (the default) shows the
--   change of account balance in each period, which is equivalent to the
--   sum of postings in each period. Here, checking's balance increased by
--   10 in Feb:</li>
--   </ul>
--   
--   <pre>
--   Change of balance (flow):
--   
--                    Jan   Feb   Mar
--   assets:checking   20    10    -5
--   </pre>
--   
--   <ul>
--   <li>A "cumulative balance" report (with <tt>--cumulative</tt>) shows
--   the accumulated ending balance across periods, starting from zero at
--   the report's start date. Here, 30 is the sum of checking postings
--   during Jan and Feb:</li>
--   </ul>
--   
--   <pre>
--   Ending balance (cumulative):
--   
--                    Jan   Feb   Mar
--   assets:checking   20    30    25
--   </pre>
--   
--   <ul>
--   <li>A "historical balance" report (with <tt>--historical/-H</tt>) also
--   shows ending balances, but it includes the starting balance from any
--   postings before the report start date. Here, 130 is the balance from
--   all checking postings at the end of Feb, including pre-Jan postings
--   which created a starting balance of 100:</li>
--   </ul>
--   
--   <pre>
--   Ending balance (historical):
--   
--                    Jan   Feb   Mar
--   assets:checking  120   130   125
--   </pre>
--   
--   <i>Eliding and omitting, 2</i>
--   
--   Here's a (imperfect?) specification for the eliding/omitting
--   behaviour:
--   
--   <ul>
--   <li>Each account is normally displayed on its own line.</li>
--   <li>An account less deep than the report's max depth, with just one
--   interesting subaccount, and the same balance as the subaccount, is
--   non-interesting, and prefixed to the subaccount's line, unless
--   <tt>--no-elide</tt> is in effect.</li>
--   <li>An account with a zero inclusive balance and less than two
--   interesting subaccounts is not displayed at all, unless
--   <tt>--empty</tt> is in effect.</li>
--   <li>Multi-column balance reports show full account names with no
--   eliding (like <tt>--flat</tt>). Accounts (and periods) are omitted as
--   described below.</li>
--   </ul>
--   
--   <i>Which accounts to show in balance reports</i>
--   
--   By default:
--   
--   <ul>
--   <li>single-column: accounts with non-zero balance in report period.
--   (With <tt>--flat</tt>: accounts with non-zero balance and
--   postings.)</li>
--   <li>periodic: accounts with postings and non-zero period balance in
--   any period</li>
--   <li>cumulative: accounts with non-zero cumulative balance in any
--   period</li>
--   <li>historical: accounts with non-zero historical balance in any
--   period</li>
--   </ul>
--   
--   With <tt>-E/--empty</tt>:
--   
--   <ul>
--   <li>single-column: accounts with postings in report period</li>
--   <li>periodic: accounts with postings in report period</li>
--   <li>cumulative: accounts with postings in report period</li>
--   <li>historical: accounts with non-zero starting balance + accounts
--   with postings in report period</li>
--   </ul>
--   
--   <i>Which periods (columns) to show in balance reports</i>
--   
--   An empty period/column is one where no report account has any
--   postings. A zero period/column is one where no report account has a
--   non-zero period balance.
--   
--   Currently,
--   
--   by default:
--   
--   <ul>
--   <li>single-column: N/A</li>
--   <li>periodic: all periods within the overall report period, except for
--   leading and trailing empty periods</li>
--   <li>cumulative: all periods within the overall report period, except
--   for leading and trailing empty periods</li>
--   <li>historical: all periods within the overall report period, except
--   for leading and trailing empty periods</li>
--   </ul>
--   
--   With <tt>-E/--empty</tt>:
--   
--   <ul>
--   <li>single-column: N/A</li>
--   <li>periodic: all periods within the overall report period</li>
--   <li>cumulative: all periods within the overall report period</li>
--   <li>historical: all periods within the overall report period</li>
--   </ul>
--   
--   <i>What to show in empty cells</i>
--   
--   An empty periodic balance report cell is one which has no
--   corresponding postings. An empty cumulative/historical balance report
--   cell is one which has no correponding or prior postings, ie the
--   account doesn't exist yet. Currently, empty cells show 0.
module Hledger.Cli.Balance

-- | Print a balance report.
balance :: CliOpts -> Journal -> IO ()

-- | Render an old-style single-column balance report as plain text.
balanceReportAsText :: ReportOpts -> BalanceReport -> [String]

-- | Render a multi-column period balance report as plain text suitable for
--   console output.
periodBalanceReportAsText :: ReportOpts -> MultiBalanceReport -> [String]

-- | Render a multi-column cumulative balance report as plain text suitable
--   for console output.
cumulativeBalanceReportAsText :: ReportOpts -> MultiBalanceReport -> [String]

-- | Render a multi-column historical balance report as plain text suitable
--   for console output.
historicalBalanceReportAsText :: ReportOpts -> MultiBalanceReport -> [String]
tests_Hledger_Cli_Balance :: Test


-- | The <tt>balancesheet</tt> command prints a simple balance sheet.
module Hledger.Cli.Balancesheet

-- | Print a simple balance sheet.
balancesheet :: CliOpts -> Journal -> IO ()
tests_Hledger_Cli_Balancesheet :: Test


-- | The <tt>cashflow</tt> command prints a simplified cashflow statement.
--   It just shows the change in all <a>cash</a> accounts for the period
--   (without the traditional segmentation into operating, investing, and
--   financing cash flows.)
module Hledger.Cli.Cashflow

-- | Print a simple cashflow statement.
cashflow :: CliOpts -> Journal -> IO ()
tests_Hledger_Cli_Cashflow :: Test


-- | Print a histogram report.
module Hledger.Cli.Histogram
barchar :: Char

-- | Print a histogram of some statistic per reporting interval, such as
--   number of postings per day.
histogram :: CliOpts -> Journal -> IO ()
showHistogram :: ReportOpts -> Query -> Journal -> String
printDayWith :: PrintfType (t2 -> t) => (t1 -> t2) -> (DateSpan, t1) -> t
countBar :: [a] -> [Char]


-- | The <tt>incomestatement</tt> command prints a simple income statement
--   (profit &amp; loss) report.
module Hledger.Cli.Incomestatement

-- | Print a simple income statement.
incomestatement :: CliOpts -> Journal -> IO ()
tests_Hledger_Cli_Incomestatement :: Test


-- | A ledger-compatible <tt>print</tt> command.
module Hledger.Cli.Print

-- | Print journal transactions in standard format.
print' :: CliOpts -> Journal -> IO ()
showTransactions :: ReportOpts -> Query -> Journal -> String
tests_Hledger_Cli_Print :: Test


-- | A ledger-compatible <tt>register</tt> command.
module Hledger.Cli.Register

-- | Print a (posting) register report.
register :: CliOpts -> Journal -> IO ()

-- | Render a register report as plain text suitable for console output.
postingsReportAsText :: CliOpts -> PostingsReport -> String
tests_Hledger_Cli_Register :: Test


-- | A history-aware add command to help with data entry.
--   
--   Note: this might not be sensible, but add has some aspirations of
--   being both user-friendly and pipeable/scriptable and for this reason
--   informational messages are mostly written to stderr rather than
--   stdout.
module Hledger.Cli.Add

-- | Read multiple transactions from the console, prompting for each field,
--   and append them to the journal file. If the journal came from stdin,
--   this command has no effect.
add :: CliOpts -> Journal -> IO ()

-- | Loop reading transactions from the console, prompting for, validating,
--   displaying and appending each one to the journal file, until end of
--   input or ctrl-c (then raise an EOF exception). If provided,
--   command-line arguments are used as defaults for the first transaction;
--   otherwise defaults come from the most similar recent transaction in
--   the journal.
getAndAddTransactionsLoop :: Journal -> CliOpts -> String -> [String] -> IO ()

-- | Read a single transaction from the console, with history-aware
--   prompting, allowing the user to restart and confirm at the end. A
--   default date, and zero or more defaults for subsequent fields, are
--   provided.
getTransaction :: Journal -> CliOpts -> String -> [String] -> IO Transaction

-- | Read a single transaction from the console, with history-aware
--   prompting, or return nothing indicating that the user wants to restart
--   entering this transaction. A default date, and zero or more defaults
--   for subsequent fields, are provided.
getTransactionOrRestart :: Journal -> CliOpts -> String -> [String] -> IO (Maybe Transaction)
data RestartEntryException
RestartEntryException :: RestartEntryException

-- | Information used as the basis for suggested account names, amounts
--   etc. in add prompt.
data PostingsState
PostingsState :: Journal -> (AccountName -> Bool) -> Bool -> Maybe [Posting] -> PostingsState
psJournal :: PostingsState -> Journal
psAccept :: PostingsState -> AccountName -> Bool
psSuggestHistoricalAmount :: PostingsState -> Bool
psHistory :: PostingsState -> Maybe [Posting]

-- | Loop reading postings from the console, until a valid balanced set of
--   postings has been entered, then return the final transaction, or
--   nothing indicating that the user wants to restart entering this
--   transaction.
getPostingsForTransactionWithHistory :: Journal -> CliOpts -> String -> String -> String -> String -> [String] -> IO (Maybe Transaction)

-- | Read postings from the command line until . is entered, generating
--   useful defaults based on historical context and postings entered so
--   far.
getPostingsLoop :: PostingsState -> [Posting] -> [String] -> IO [Posting]

-- | Prompt for and read a string value, optionally with a default value
--   and a validator. A validator causes the prompt to repeat until the
--   input is valid. May also raise an EOF exception if control-d or
--   control-c is pressed.
askFor :: String -> Maybe String -> Maybe (String -> Bool) -> InputT IO String

-- | Append this transaction to the journal's file, and to the journal's
--   transaction list.
journalAddTransaction :: Journal -> CliOpts -> Transaction -> IO Journal

-- | Append a string, typically one or more transactions, to a journal
--   file, or if the file is <a>-</a>, dump it to stdout. Tries to avoid
--   excess whitespace.
appendToJournalFileOrStdout :: FilePath -> String -> IO ()

-- | Replace a string's 0 or more terminating newlines with exactly one.
ensureOneNewlineTerminated :: String -> String

-- | Convert a string of journal data into a register report.
registerFromString :: String -> IO String

-- | Return a similarity measure, from 0 to 1, for two strings. This is
--   Simon White's letter pairs algorithm from
--   http:<i></i>www.catalysoft.com<i>articles</i>StrikeAMatch.html with a
--   modification for short strings.
compareStrings :: String -> String -> Double
wordLetterPairs :: String -> [[Char]]
letterPairs :: [t] -> [[t]]
compareDescriptions :: [Char] -> [Char] -> Double
transactionsSimilarTo :: Journal -> Query -> String -> [(Double, Transaction)]
runInteraction :: Journal -> InputT IO a -> IO a
runInteractionDefault :: InputT IO a -> IO a
type CompletionCache = [AccountName]
completionCache :: Journal -> CompletionCache
accountCompletion :: CompletionCache -> CompletionFunc IO
capitalize :: String -> String
headTailDef :: a -> [a] -> (a, [a])
instance Typeable RestartEntryException
instance Show RestartEntryException
instance Exception RestartEntryException


-- | Print some statistics for the journal.
module Hledger.Cli.Stats

-- | Print various statistics for the journal.
stats :: CliOpts -> Journal -> IO ()
showLedgerStats :: Ledger -> Day -> DateSpan -> String


-- | Utilities for top-level modules and ghci. See also Hledger.Read and
--   Hledger.Utils.
module Hledger.Cli.Utils

-- | Parse the user's specified journal file and run a hledger command on
--   it, or throw an error.
withJournalDo :: CliOpts -> (CliOpts -> Journal -> IO ()) -> IO ()

-- | Re-read a journal from its data file, or return an error string.
journalReload :: Journal -> IO (Either String Journal)

-- | Re-read a journal from its data file mostly, only if the file has
--   changed since last read (or if there is no file, ie data read from
--   stdin). The provided options are mostly ignored. Return a journal or
--   the error message while reading it, and a flag indicating whether it
--   was re-read or not.
journalReloadIfChanged :: CliOpts -> Journal -> IO (Either String Journal, Bool)

-- | Has the journal's main data file changed since the journal was last
--   read ?
journalFileIsNewer :: Journal -> IO Bool

-- | Has the specified file (presumably one of journal's data files)
--   changed since journal was last read ?
journalSpecifiedFileIsNewer :: Journal -> FilePath -> IO Bool

-- | Get the last modified time of the specified file, or if it does not
--   exist or there is some other error, the current time.
fileModificationTime :: FilePath -> IO ClockTime

-- | Attempt to open a web browser on the given url, all platforms.
openBrowserOn :: String -> IO ExitCode

-- | Back up this file with a (incrementing) numbered suffix, then
--   overwrite it with this new text, or give an error.
writeFileWithBackup :: FilePath -> String -> IO ()

-- | Back up this file with a (incrementing) numbered suffix then overwrite
--   it with this new text, or give an error, but only if the text is
--   different from the current file contents, and return a flag indicating
--   whether we did anything.
writeFileWithBackupIfChanged :: FilePath -> String -> IO Bool
readFileStrictly :: FilePath -> IO String

-- | The basic structure used to create an annotated tree of test cases.
data Test :: *

-- | A set of <tt>Test</tt>s sharing the same level in the hierarchy.
TestList :: [Test] -> Test


-- | Hledger.Cli re-exports the options, utilities and commands provided by
--   the hledger command-line program. This module also aggregates the
--   built-in unit tests defined throughout hledger and hledger-lib, and
--   adds some more which are easier to define here.
module Hledger.Cli
tests_Hledger_Cli :: Test


-- | A simple test runner for hledger's built-in unit tests.
module Hledger.Cli.Tests

-- | Run HUnit unit tests and exit with success or failure.
test' :: CliOpts -> IO ()

-- | Run all or just the matched unit tests and return their HUnit result
--   counts.
runTests :: CliOpts -> IO Counts

-- | Run all or just the matched unit tests until the first failure or
--   error, returning the name of the problem test if any.
runTestsTillFailure :: CliOpts -> IO (Maybe String)

-- | All or pattern-matched tests, as a flat list to show simple names.
flatTests :: CliOpts -> Test

-- | All or pattern-matched tests, in the original suites to show
--   hierarchical names.
hierarchicalTests :: CliOpts -> Test


-- | hledger - a ledger-compatible accounting tool. Copyright (c) 2007-2011
--   Simon Michael <a>simon@joyful.com</a> Released under GPL version 3 or
--   later.
--   
--   hledger is a partial haskell clone of John Wiegley's <a>ledger</a>. It
--   generates ledger-compatible register &amp; balance reports from a
--   plain text journal, and demonstrates a functional implementation of
--   ledger. For more information, see http://hledger.org .
--   
--   This module provides the main function for the hledger command-line
--   executable. It is exposed here so that it can be imported by eg
--   benchmark scripts.
--   
--   You can use the command line:
--   
--   <pre>
--   $ hledger --help
--   </pre>
--   
--   or ghci:
--   
--   <pre>
--   $ ghci hledger
--   &gt; j &lt;- readJournalFile Nothing Nothing "data/sample.journal"
--   &gt; register [] ["income","expenses"] j
--   2008/01/01 income               income:salary                   $-1          $-1
--   2008/06/01 gift                 income:gifts                    $-1          $-2
--   2008/06/03 eat &amp; shop           expenses:food                    $1          $-1
--                                   expenses:supplies                $1            0
--   &gt; balance [Depth "1"] [] l
--                    $-1  assets
--                     $2  expenses
--                    $-2  income
--                     $1  liabilities
--   &gt; l &lt;- myLedger
--   </pre>
--   
--   See <a>Hledger.Data.Ledger</a> for more examples.
module Hledger.Cli.Main
main :: IO ()
