stop depending on here due to slow haskell-src-meta/stackage issues

Using file-embed or ordinary literals instead, for now.
This commit is contained in:
Simon Michael 2019-02-02 16:34:10 -08:00
parent e1622bcca6
commit 86d5652e53
30 changed files with 111 additions and 121 deletions

View File

@ -37,18 +37,18 @@ where
import Control.Monad (liftM, when) import Control.Monad (liftM, when)
-- import Data.Char -- import Data.Char
import Data.Default import Data.Default
import Data.FileEmbed (makeRelativeToProject, embedFile) import Data.FileEmbed (makeRelativeToProject, embedStringFile)
import Data.List import Data.List
-- import Data.Maybe -- import Data.Maybe
-- import Data.PPrint -- import Data.PPrint
import Data.String.Here (hereFile) -- import Data.String.Here (hereFile)
import Data.Text (Text) import Data.Text (Text)
import qualified Data.Text.IO as T import qualified Data.Text.IO as T
import Data.Time.Clock import Data.Time.Clock
import Data.Time.LocalTime import Data.Time.LocalTime
-- import Data.Text (Text) -- import Data.Text (Text)
-- import qualified Data.Text as T -- import qualified Data.Text as T
import Language.Haskell.TH.Quote (QuasiQuoter(..)) -- import Language.Haskell.TH.Quote (QuasiQuoter(..))
import Language.Haskell.TH.Syntax (Q, Exp) import Language.Haskell.TH.Syntax (Q, Exp)
import System.Directory (getHomeDirectory) import System.Directory (getHomeDirectory)
import System.FilePath((</>), isRelative) import System.FilePath((</>), isRelative)
@ -225,16 +225,16 @@ mapM' :: Monad f => (a -> f b) -> [a] -> f [b]
mapM' f = sequence' . map f mapM' f = sequence' . map f
-- | Like embedFile, but takes a path relative to the package directory. -- | Like embedFile, but takes a path relative to the package directory.
-- Similar to hereFileRelative ?
embedFileRelative :: FilePath -> Q Exp
embedFileRelative f = makeRelativeToProject f >>= embedFile
-- | Like hereFile, but takes a path relative to the package directory.
-- Similar to embedFileRelative ? -- Similar to embedFileRelative ?
hereFileRelative :: FilePath -> Q Exp embedFileRelative :: FilePath -> Q Exp
hereFileRelative f = makeRelativeToProject f >>= hereFileExp embedFileRelative f = makeRelativeToProject f >>= embedStringFile
where
QuasiQuoter{quoteExp=hereFileExp} = hereFile -- -- | Like hereFile, but takes a path relative to the package directory.
-- -- Similar to embedFileRelative ?
-- hereFileRelative :: FilePath -> Q Exp
-- hereFileRelative f = makeRelativeToProject f >>= hereFileExp
-- where
-- QuasiQuoter{quoteExp=hereFileExp} = hereFile
tests_Utils = tests "Utils" [ tests_Utils = tests "Utils" [
tests_Text tests_Text

View File

@ -4,7 +4,7 @@ cabal-version: 1.12
-- --
-- see: https://github.com/sol/hpack -- see: https://github.com/sol/hpack
-- --
-- hash: c17b44c345a89a13650ca3efcba7d7e8311e9312acfd08dff5f2716e70ca29d7 -- hash: 25ebf00dbf3312c8ce9cef75a4e0dbc04608eca66a179fb6fdc92d9d5e1c3b54
name: hledger-lib name: hledger-lib
version: 1.13 version: 1.13
@ -124,7 +124,6 @@ library
, file-embed >=0.0.10 , file-embed >=0.0.10
, filepath , filepath
, hashtables >=1.2.3.1 , hashtables >=1.2.3.1
, here
, megaparsec >=7.0.0 && <8 , megaparsec >=7.0.0 && <8
, mtl , mtl
, mtl-compat , mtl-compat
@ -227,7 +226,6 @@ test-suite doctests
, file-embed >=0.0.10 , file-embed >=0.0.10
, filepath , filepath
, hashtables >=1.2.3.1 , hashtables >=1.2.3.1
, here
, megaparsec >=7.0.0 && <8 , megaparsec >=7.0.0 && <8
, mtl , mtl
, mtl-compat , mtl-compat
@ -329,7 +327,6 @@ test-suite easytests
, file-embed >=0.0.10 , file-embed >=0.0.10
, filepath , filepath
, hashtables >=1.2.3.1 , hashtables >=1.2.3.1
, here
, hledger-lib , hledger-lib
, megaparsec >=7.0.0 && <8 , megaparsec >=7.0.0 && <8
, mtl , mtl

View File

@ -58,7 +58,6 @@ dependencies:
- file-embed >=0.0.10 - file-embed >=0.0.10
- filepath - filepath
- hashtables >=1.2.3.1 - hashtables >=1.2.3.1
- here
- megaparsec >=7.0.0 && <8 - megaparsec >=7.0.0 && <8
- mtl - mtl
- mtl-compat - mtl-compat

View File

@ -47,7 +47,6 @@ import Data.List
#if !(MIN_VERSION_base(4,11,0)) #if !(MIN_VERSION_base(4,11,0))
import Data.Monoid ((<>)) import Data.Monoid ((<>))
#endif #endif
import Data.String.Here
import Data.Text (Text) import Data.Text (Text)
import qualified Data.Text as T import qualified Data.Text as T
import Data.Time.Calendar import Data.Time.Calendar
@ -132,63 +131,63 @@ builtinCommands = [
-- TODO: generate more of this automatically. -- TODO: generate more of this automatically.
-- --
commandsList :: String commandsList :: String
commandsList = [here| commandsList = unlines [
------------------------------------------------------------------------------- "-------------------------------------------------------------------------------"
PROGVERSION ,"PROGVERSION"
Usage: hledger COMMAND [OPTIONS] [-- ADDONCMDOPTIONS] ,"Usage: hledger COMMAND [OPTIONS] [-- ADDONCMDOPTIONS]"
Commands (+ addons found in $PATH): ,"Commands (+ addons found in $PATH):"
,""
Data entry (these commands modify the journal file): ,"Data entry (these commands modify the journal file):"
add add transactions using guided prompts ," add add transactions using guided prompts"
+iadd add transactions using curses ui ,"+iadd add transactions using curses ui"
import add any new transactions from other files (eg csv) ," import add any new transactions from other files (eg csv)"
,""
Data management: ,"Data management:"
+autosync download/deduplicate/convert OFX data ,"+autosync download/deduplicate/convert OFX data"
+check check more powerful balance assertions ,"+check check more powerful balance assertions"
check-dates check transactions are ordered by date ," check-dates check transactions are ordered by date"
check-dupes check for accounts with the same leaf name ," check-dupes check for accounts with the same leaf name"
close (equity) generate balance-resetting transactions ," close (equity) generate balance-resetting transactions"
+diff compare account transactions in two journal files ,"+diff compare account transactions in two journal files"
+interest generate interest transactions ,"+interest generate interest transactions"
rewrite generate automated postings/diffs (old, use --auto) ," rewrite generate automated postings/diffs (old, use --auto)"
,""
Financial reports: ,"Financial reports:"
balancesheet (bs) show assets, liabilities and net worth ," balancesheet (bs) show assets, liabilities and net worth"
balancesheetequity (bse) show assets, liabilities and equity ," balancesheetequity (bse) show assets, liabilities and equity"
cashflow (cf) show changes in liquid assets ," cashflow (cf) show changes in liquid assets"
incomestatement (is) show revenues and expenses ," incomestatement (is) show revenues and expenses"
+irr calculate internal rate of return (old, use roi) ,"+irr calculate internal rate of return (old, use roi)"
roi show return on investments ," roi show return on investments"
,""
Low-level reports: ,"Low-level reports:"
accounts (a) show account names ," accounts (a) show account names"
activity show postings-per-interval bar charts ," activity show postings-per-interval bar charts"
balance (b, bal) show balance changes/end balances/budgets in accounts ," balance (b, bal) show balance changes/end balances/budgets in accounts"
files show input file paths ," files show input file paths"
prices show market price records ," prices show market price records"
print (p, txns) show transactions (journal entries) ," print (p, txns) show transactions (journal entries)"
print-unique show only transactions with unique descriptions ," print-unique show only transactions with unique descriptions"
register (r, reg) show postings in one or more accounts & running total ," register (r, reg) show postings in one or more accounts & running total"
register-match show a recent posting that best matches a description ," register-match show a recent posting that best matches a description"
stats show journal statistics ," stats show journal statistics"
tags show tag names ," tags show tag names"
test run self tests ," test run self tests"
,""
Alternate user interfaces: ,"Alternate user interfaces:"
+ui run curses ui ,"+ui run curses ui"
+web run web ui ,"+web run web ui"
+api run http api server ,"+api run http api server"
,""
Other: ,"Other:"
OTHER ,"OTHER"
Help: ,"Help:"
(no arguments) show this commands list ," (no arguments) show this commands list"
-h show general flags ," -h show general flags"
COMMAND -h show flags & docs for COMMAND ," COMMAND -h show flags & docs for COMMAND"
help [MANUAL] show hledger manuals in various formats ," help [MANUAL] show hledger manuals in various formats"
,""
|] ]
-- commands show brief commands list -- commands show brief commands list
-- edit open a text editor on some part of the journal -- edit open a text editor on some part of the journal
-- aregister (ar, areg) show transactions in a single account -- aregister (ar, areg) show transactions in a single account
@ -236,7 +235,7 @@ printCommandsList addonsFound =
-- The test command is defined here for easy access to other modules' tests. -- The test command is defined here for easy access to other modules' tests.
testmode = hledgerCommandMode testmode = hledgerCommandMode
$(hereFileRelative "Hledger/Cli/Commands/Test.txt") $(embedFileRelative "Hledger/Cli/Commands/Test.txt")
[] []
[generalflagsgroup3] [generalflagsgroup3]
[] []

View File

@ -35,7 +35,7 @@ import Hledger.Cli.CliOptions
-- | Command line options for this command. -- | Command line options for this command.
accountsmode = hledgerCommandMode accountsmode = hledgerCommandMode
$(hereFileRelative "Hledger/Cli/Commands/Accounts.txt") $(embedFileRelative "Hledger/Cli/Commands/Accounts.txt")
[flagNone ["declared"] (\opts -> setboolopt "declared" opts) "show account names declared with account directives" [flagNone ["declared"] (\opts -> setboolopt "declared" opts) "show account names declared with account directives"
,flagNone ["used"] (\opts -> setboolopt "used" opts) "show account names referenced by transactions" ,flagNone ["used"] (\opts -> setboolopt "used" opts) "show account names referenced by transactions"
,flagNone ["tree"] (\opts -> setboolopt "tree" opts) "show short account names, as a tree" ,flagNone ["tree"] (\opts -> setboolopt "tree" opts) "show short account names, as a tree"

View File

@ -20,7 +20,7 @@ import Prelude hiding (putStr)
import Hledger.Utils.UTF8IOCompat (putStr) import Hledger.Utils.UTF8IOCompat (putStr)
activitymode = hledgerCommandMode activitymode = hledgerCommandMode
$(hereFileRelative "Hledger/Cli/Commands/Activity.txt") $(embedFileRelative "Hledger/Cli/Commands/Activity.txt")
[] []
[generalflagsgroup1] [generalflagsgroup1]
[] []

View File

@ -48,7 +48,7 @@ import Hledger.Cli.Commands.Register (postingsReportAsText)
addmode = hledgerCommandMode addmode = hledgerCommandMode
$(hereFileRelative "Hledger/Cli/Commands/Add.txt") $(embedFileRelative "Hledger/Cli/Commands/Add.txt")
[flagNone ["no-new-accounts"] (\opts -> setboolopt "no-new-accounts" opts) "don't allow creating new accounts"] [flagNone ["no-new-accounts"] (\opts -> setboolopt "no-new-accounts" opts) "don't allow creating new accounts"]
[generalflagsgroup2] [generalflagsgroup2]
[] []

View File

@ -270,7 +270,7 @@ import Hledger.Read.CsvReader (CSV, printCSV)
-- | Command line options for this command. -- | Command line options for this command.
balancemode = hledgerCommandMode balancemode = hledgerCommandMode
$(hereFileRelative "Hledger/Cli/Commands/Balance.txt") $(embedFileRelative "Hledger/Cli/Commands/Balance.txt")
([flagNone ["change"] (\opts -> setboolopt "change" opts) ([flagNone ["change"] (\opts -> setboolopt "change" opts)
"show balance change in each period (default)" "show balance change in each period (default)"
,flagNone ["cumulative"] (\opts -> setboolopt "cumulative" opts) ,flagNone ["cumulative"] (\opts -> setboolopt "cumulative" opts)

View File

@ -18,7 +18,7 @@ import Hledger.Cli.CliOptions
import Hledger.Cli.CompoundBalanceCommand import Hledger.Cli.CompoundBalanceCommand
balancesheetSpec = CompoundBalanceCommandSpec { balancesheetSpec = CompoundBalanceCommandSpec {
cbcdoc = ($(hereFileRelative "Hledger/Cli/Commands/Balancesheet.txt")), cbcdoc = ($(embedFileRelative "Hledger/Cli/Commands/Balancesheet.txt")),
cbctitle = "Balance Sheet", cbctitle = "Balance Sheet",
cbcqueries = [ cbcqueries = [
CBCSubreportSpec{ CBCSubreportSpec{

View File

@ -18,7 +18,7 @@ import Hledger.Cli.CliOptions
import Hledger.Cli.CompoundBalanceCommand import Hledger.Cli.CompoundBalanceCommand
balancesheetequitySpec = CompoundBalanceCommandSpec { balancesheetequitySpec = CompoundBalanceCommandSpec {
cbcdoc = ($(hereFileRelative "Hledger/Cli/Commands/Balancesheetequity.txt")), cbcdoc = ($(embedFileRelative "Hledger/Cli/Commands/Balancesheetequity.txt")),
cbctitle = "Balance Sheet With Equity", cbctitle = "Balance Sheet With Equity",
cbcqueries = [ cbcqueries = [
CBCSubreportSpec{ CBCSubreportSpec{

View File

@ -21,7 +21,7 @@ import Hledger.Cli.CliOptions
import Hledger.Cli.CompoundBalanceCommand import Hledger.Cli.CompoundBalanceCommand
cashflowSpec = CompoundBalanceCommandSpec { cashflowSpec = CompoundBalanceCommandSpec {
cbcdoc = ($(hereFileRelative "Hledger/Cli/Commands/Cashflow.txt")), cbcdoc = ($(embedFileRelative "Hledger/Cli/Commands/Cashflow.txt")),
cbctitle = "Cashflow Statement", cbctitle = "Cashflow Statement",
cbcqueries = [ cbcqueries = [
CBCSubreportSpec{ CBCSubreportSpec{

View File

@ -13,7 +13,7 @@ import Text.Printf
checkdatesmode :: Mode RawOpts checkdatesmode :: Mode RawOpts
checkdatesmode = hledgerCommandMode checkdatesmode = hledgerCommandMode
($(hereFileRelative "Hledger/Cli/Commands/Checkdates.txt")) ($(embedFileRelative "Hledger/Cli/Commands/Checkdates.txt"))
[flagNone ["strict"] (\opts -> setboolopt "strict" opts) "makes date comparing strict"] [flagNone ["strict"] (\opts -> setboolopt "strict" opts) "makes date comparing strict"]
[generalflagsgroup1] [generalflagsgroup1]
[] []

View File

@ -16,7 +16,7 @@ import Text.Printf
checkdupesmode :: Mode RawOpts checkdupesmode :: Mode RawOpts
checkdupesmode = hledgerCommandMode checkdupesmode = hledgerCommandMode
($(hereFileRelative "Hledger/Cli/Commands/Checkdupes.txt")) ($(embedFileRelative "Hledger/Cli/Commands/Checkdupes.txt"))
[] []
[generalflagsgroup1] [generalflagsgroup1]
[] []

View File

@ -16,7 +16,7 @@ import Hledger
import Hledger.Cli.CliOptions import Hledger.Cli.CliOptions
closemode = hledgerCommandMode closemode = hledgerCommandMode
$(hereFileRelative "Hledger/Cli/Commands/Close.txt") $(embedFileRelative "Hledger/Cli/Commands/Close.txt")
[flagNone ["opening"] (\opts -> setboolopt "opening" opts) "show just opening transaction" [flagNone ["opening"] (\opts -> setboolopt "opening" opts) "show just opening transaction"
,flagNone ["closing"] (\opts -> setboolopt "closing" opts) "show just closing transaction" ,flagNone ["closing"] (\opts -> setboolopt "closing" opts) "show just closing transaction"
] ]

View File

@ -23,7 +23,7 @@ import Hledger.Cli.CliOptions
-- | Command line options for this command. -- | Command line options for this command.
filesmode = hledgerCommandMode filesmode = hledgerCommandMode
($(hereFileRelative "Hledger/Cli/Commands/Files.txt")) ($(embedFileRelative "Hledger/Cli/Commands/Files.txt"))
[] []
[generalflagsgroup2] [generalflagsgroup2]
[] []

View File

@ -20,7 +20,6 @@ module Hledger.Cli.Commands.Help (
import Prelude () import Prelude ()
import "base-compat-batteries" Prelude.Compat import "base-compat-batteries" Prelude.Compat
import Data.Char import Data.Char
import Data.String.Here
import Data.List import Data.List
import Data.Maybe import Data.Maybe
import Safe import Safe
@ -28,7 +27,7 @@ import System.Console.CmdArgs.Explicit
import System.Environment import System.Environment
import System.IO import System.IO
import Hledger.Utils (hereFileRelative) import Hledger.Utils (embedFileRelative)
import Hledger.Data.RawOptions import Hledger.Data.RawOptions
import Hledger.Data.Types import Hledger.Data.Types
import Hledger.Cli.CliOptions import Hledger.Cli.CliOptions
@ -36,7 +35,7 @@ import Hledger.Cli.DocFiles
--import Hledger.Utils.Debug --import Hledger.Utils.Debug
helpmode = hledgerCommandMode helpmode = hledgerCommandMode
($(hereFileRelative "Hledger/Cli/Commands/Help.txt")) ($(embedFileRelative "Hledger/Cli/Commands/Help.txt"))
[flagNone ["info"] (setboolopt "info") "show the manual with info" [flagNone ["info"] (setboolopt "info") "show the manual with info"
,flagNone ["man"] (setboolopt "man") "show the manual with man" ,flagNone ["man"] (setboolopt "man") "show the manual with man"
,flagNone ["pager"] (setboolopt "pager") "show the manual with $PAGER or less" ,flagNone ["pager"] (setboolopt "pager") "show the manual with $PAGER or less"
@ -74,9 +73,10 @@ help' opts _ = do
| pagerprog `elem` exes = pager | pagerprog `elem` exes = pager
| otherwise = cat | otherwise = cat
case topic of case topic of
Nothing -> putStrLn $ [here| Nothing -> putStrLn $ unlines [
Please choose a manual by typing "hledger help MANUAL" (any substring is ok). "Please choose a manual by typing \"hledger help MANUAL\" (any substring is ok)."
A viewer (info, man, a pager, or stdout) will be auto-selected, ,"A viewer (info, man, a pager, or stdout) will be auto-selected,"
or type "hledger help -h" to see options. Manuals available: ,"or type \"hledger help -h\" to see options. Manuals available:"
|] ++ "\n " ++ intercalate " " docTopics ]
++ "\n " ++ intercalate " " docTopics
Just t -> viewer t Just t -> viewer t

View File

@ -18,7 +18,7 @@ import System.Console.CmdArgs.Explicit
import Text.Printf import Text.Printf
importmode = hledgerCommandMode importmode = hledgerCommandMode
($(hereFileRelative "Hledger/Cli/Commands/Import.txt")) ($(embedFileRelative "Hledger/Cli/Commands/Import.txt"))
[flagNone ["dry-run"] (\opts -> setboolopt "dry-run" opts) "just show the transactions to be imported"] [flagNone ["dry-run"] (\opts -> setboolopt "dry-run" opts) "just show the transactions to be imported"]
[generalflagsgroup1] [generalflagsgroup1]
[] []

View File

@ -17,7 +17,7 @@ import Hledger.Cli.CliOptions
import Hledger.Cli.CompoundBalanceCommand import Hledger.Cli.CompoundBalanceCommand
incomestatementSpec = CompoundBalanceCommandSpec { incomestatementSpec = CompoundBalanceCommandSpec {
cbcdoc = ($(hereFileRelative "Hledger/Cli/Commands/Incomestatement.txt")), cbcdoc = ($(embedFileRelative "Hledger/Cli/Commands/Incomestatement.txt")),
cbctitle = "Income Statement", cbctitle = "Income Statement",
cbcqueries = [ cbcqueries = [
CBCSubreportSpec{ CBCSubreportSpec{

View File

@ -15,7 +15,7 @@ import Hledger.Cli.CliOptions
import System.Console.CmdArgs.Explicit import System.Console.CmdArgs.Explicit
pricesmode = hledgerCommandMode pricesmode = hledgerCommandMode
($(hereFileRelative "Hledger/Cli/Commands/Prices.txt")) ($(embedFileRelative "Hledger/Cli/Commands/Prices.txt"))
[flagNone ["costs"] (setboolopt "costs") "print transaction prices from postings" [flagNone ["costs"] (setboolopt "costs") "print transaction prices from postings"
,flagNone ["inverted-costs"] (setboolopt "inverted-costs") "print transaction inverted prices from postings also"] ,flagNone ["inverted-costs"] (setboolopt "inverted-costs") "print transaction inverted prices from postings also"]
[generalflagsgroup1] [generalflagsgroup1]

View File

@ -27,7 +27,7 @@ import Hledger.Cli.Commands.Add ( transactionsSimilarTo )
printmode = hledgerCommandMode printmode = hledgerCommandMode
($(hereFileRelative "Hledger/Cli/Commands/Print.txt")) ($(embedFileRelative "Hledger/Cli/Commands/Print.txt"))
[let arg = "STR" in [let arg = "STR" in
flagReq ["match","m"] (\s opts -> Right $ setopt "match" s opts) arg flagReq ["match","m"] (\s opts -> Right $ setopt "match" s opts) arg
("show the transaction whose description is most similar to "++arg++", and is most recent") ("show the transaction whose description is most similar to "++arg++", and is most recent")

View File

@ -13,7 +13,7 @@ import Hledger.Cli.CliOptions
import Hledger.Cli.Commands.Print import Hledger.Cli.Commands.Print
printuniquemode = hledgerCommandMode printuniquemode = hledgerCommandMode
($(hereFileRelative "Hledger/Cli/Commands/Printunique.txt")) ($(embedFileRelative "Hledger/Cli/Commands/Printunique.txt"))
[] []
[generalflagsgroup1] [generalflagsgroup1]
[] []

View File

@ -28,7 +28,7 @@ import Hledger.Cli.CliOptions
import Hledger.Cli.Utils import Hledger.Cli.Utils
registermode = hledgerCommandMode registermode = hledgerCommandMode
($(hereFileRelative "Hledger/Cli/Commands/Register.txt")) ($(embedFileRelative "Hledger/Cli/Commands/Register.txt"))
[flagNone ["cumulative"] (\opts -> setboolopt "change" opts) [flagNone ["cumulative"] (\opts -> setboolopt "change" opts)
"show running total from report start date (default)" "show running total from report start date (default)"
,flagNone ["historical","H"] (\opts -> setboolopt "historical" opts) ,flagNone ["historical","H"] (\opts -> setboolopt "historical" opts)

View File

@ -15,7 +15,7 @@ import Hledger.Cli.CliOptions
import Hledger.Cli.Commands.Register import Hledger.Cli.Commands.Register
registermatchmode = hledgerCommandMode registermatchmode = hledgerCommandMode
($(hereFileRelative "Hledger/Cli/Commands/Registermatch.txt")) ($(embedFileRelative "Hledger/Cli/Commands/Registermatch.txt"))
[] []
[generalflagsgroup1] [generalflagsgroup1]
[] []

View File

@ -23,7 +23,7 @@ import Text.Megaparsec
import qualified Data.Algorithm.Diff as D import qualified Data.Algorithm.Diff as D
rewritemode = hledgerCommandMode rewritemode = hledgerCommandMode
($(hereFileRelative "Hledger/Cli/Commands/Rewrite.txt")) ($(embedFileRelative "Hledger/Cli/Commands/Rewrite.txt"))
[flagReq ["add-posting"] (\s opts -> Right $ setopt "add-posting" s opts) "'ACCT AMTEXPR'" [flagReq ["add-posting"] (\s opts -> Right $ setopt "add-posting" s opts) "'ACCT AMTEXPR'"
"add a posting to ACCT, which may be parenthesised. AMTEXPR is either a literal amount, or *N which means the transaction's first matched amount multiplied by N (a decimal number). Two spaces separate ACCT and AMTEXPR." "add a posting to ACCT, which may be parenthesised. AMTEXPR is either a literal amount, or *N which means the transaction's first matched amount multiplied by N (a decimal number). Two spaces separate ACCT and AMTEXPR."
,flagNone ["diff"] (setboolopt "diff") "generate diff suitable as an input for patch tool" ,flagNone ["diff"] (setboolopt "diff") "generate diff suitable as an input for patch tool"

View File

@ -30,7 +30,7 @@ import Hledger.Cli.CliOptions
roimode = hledgerCommandMode roimode = hledgerCommandMode
($(hereFileRelative "Hledger/Cli/Commands/Roi.txt")) ($(embedFileRelative "Hledger/Cli/Commands/Roi.txt"))
[flagNone ["cashflow"] (setboolopt "cashflow") "show all amounts that were used to compute returns" [flagNone ["cashflow"] (setboolopt "cashflow") "show all amounts that were used to compute returns"
,flagReq ["investment"] (\s opts -> Right $ setopt "investment" s opts) "QUERY" ,flagReq ["investment"] (\s opts -> Right $ setopt "investment" s opts) "QUERY"
"query to select your investment transactions" "query to select your investment transactions"

View File

@ -31,7 +31,7 @@ import Hledger.Cli.Utils (writeOutput)
statsmode = hledgerCommandMode statsmode = hledgerCommandMode
($(hereFileRelative "Hledger/Cli/Commands/Stats.txt")) ($(embedFileRelative "Hledger/Cli/Commands/Stats.txt"))
[flagReq ["output-file","o"] (\s opts -> Right $ setopt "output-file" s opts) "FILE" "write output to FILE. A file extension matching one of the above formats selects that format." [flagReq ["output-file","o"] (\s opts -> Right $ setopt "output-file" s opts) "FILE" "write output to FILE. A file extension matching one of the above formats selects that format."
] ]
[generalflagsgroup1] [generalflagsgroup1]

View File

@ -14,7 +14,7 @@ import Hledger
import Hledger.Cli.CliOptions import Hledger.Cli.CliOptions
tagsmode = hledgerCommandMode tagsmode = hledgerCommandMode
($(hereFileRelative "Hledger/Cli/Commands/Tags.txt")) ($(embedFileRelative "Hledger/Cli/Commands/Tags.txt"))
[] -- [flagNone ["strict"] (\opts -> setboolopt "strict" opts) "makes date comparing strict"] -- [] -- [flagNone ["strict"] (\opts -> setboolopt "strict" opts) "makes date comparing strict"] --
[generalflagsgroup1] [generalflagsgroup1]
[] []

View File

@ -42,7 +42,6 @@ module Hledger.Cli.Main where
import Data.Char (isDigit) import Data.Char (isDigit)
import Data.List import Data.List
import Data.String.Here
import Safe import Safe
import System.Console.CmdArgs.Explicit as C import System.Console.CmdArgs.Explicit as C
import System.Environment import System.Environment
@ -83,14 +82,15 @@ mainmode addons = defMode {
[detailedversionflag] [detailedversionflag]
-- ++ inputflags -- included here so they'll not raise a confusing error if present with no COMMAND -- ++ inputflags -- included here so they'll not raise a confusing error if present with no COMMAND
} }
,modeHelpSuffix = lines $ regexReplace "PROGNAME" progname [here|Examples: ,modeHelpSuffix = map (regexReplace "PROGNAME" progname) [
PROGNAME list commands "Examples:"
PROGNAME CMD [--] [OPTS] [ARGS] run a command (use -- with addon commands) ,"PROGNAME list commands"
PROGNAME-CMD [OPTS] [ARGS] or run addon commands directly ,"PROGNAME CMD [--] [OPTS] [ARGS] run a command (use -- with addon commands)"
PROGNAME -h show general usage ,"PROGNAME-CMD [OPTS] [ARGS] or run addon commands directly"
PROGNAME CMD -h show command usage ,"PROGNAME -h show general usage"
PROGNAME help [MANUAL] show any of the hledger manuals in various formats ,"PROGNAME CMD -h show command usage"
|] ,"PROGNAME help [MANUAL] show any of the hledger manuals in various formats"
]
} }
-- | Let's go! -- | Let's go!

View File

@ -4,7 +4,7 @@ cabal-version: 1.12
-- --
-- see: https://github.com/sol/hpack -- see: https://github.com/sol/hpack
-- --
-- hash: 0f31726cb805b74d59400bb1d7502bb6c6c7f01eb41ac0272c4da6a8d94144b2 -- hash: 23ad53c1065d2d491ad11197683363d92136d6117de4ea6cc258865b82b5fc52
name: hledger name: hledger
version: 1.13 version: 1.13
@ -152,7 +152,6 @@ library
, filepath , filepath
, hashable >=1.2.4 , hashable >=1.2.4
, haskeline >=0.6 , haskeline >=0.6
, here
, hledger-lib >=1.13 && <1.14 , hledger-lib >=1.13 && <1.14
, lucid , lucid
, math-functions >=0.2.0.0 , math-functions >=0.2.0.0
@ -202,7 +201,6 @@ executable hledger
, easytest , easytest
, filepath , filepath
, haskeline >=0.6 , haskeline >=0.6
, here
, hledger , hledger
, hledger-lib >=1.13 && <1.14 , hledger-lib >=1.13 && <1.14
, math-functions >=0.2.0.0 , math-functions >=0.2.0.0
@ -255,7 +253,6 @@ test-suite test
, easytest , easytest
, filepath , filepath
, haskeline >=0.6 , haskeline >=0.6
, here
, hledger , hledger
, hledger-lib >=1.13 && <1.14 , hledger-lib >=1.13 && <1.14
, math-functions >=0.2.0.0 , math-functions >=0.2.0.0
@ -308,7 +305,6 @@ benchmark bench
, easytest , easytest
, filepath , filepath
, haskeline >=0.6 , haskeline >=0.6
, here
, hledger , hledger
, hledger-lib >=1.13 && <1.14 , hledger-lib >=1.13 && <1.14
, html , html

View File

@ -116,7 +116,6 @@ dependencies:
- easytest - easytest
- filepath - filepath
- haskeline >=0.6 - haskeline >=0.6
- here
- megaparsec >=7.0.0 && <8 - megaparsec >=7.0.0 && <8
- mtl - mtl
- mtl-compat - mtl-compat