From 86d5652e53d02c0ad810248e753dac3e6a54f8c5 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 2 Feb 2019 16:34:10 -0800 Subject: [PATCH] stop depending on here due to slow haskell-src-meta/stackage issues Using file-embed or ordinary literals instead, for now. --- hledger-lib/Hledger/Utils.hs | 24 ++-- hledger-lib/hledger-lib.cabal | 5 +- hledger-lib/package.yaml | 1 - hledger/Hledger/Cli/Commands.hs | 117 +++++++++--------- hledger/Hledger/Cli/Commands/Accounts.hs | 2 +- hledger/Hledger/Cli/Commands/Activity.hs | 2 +- hledger/Hledger/Cli/Commands/Add.hs | 2 +- hledger/Hledger/Cli/Commands/Balance.hs | 2 +- hledger/Hledger/Cli/Commands/Balancesheet.hs | 2 +- .../Cli/Commands/Balancesheetequity.hs | 2 +- hledger/Hledger/Cli/Commands/Cashflow.hs | 2 +- hledger/Hledger/Cli/Commands/Checkdates.hs | 2 +- hledger/Hledger/Cli/Commands/Checkdupes.hs | 2 +- hledger/Hledger/Cli/Commands/Close.hs | 2 +- hledger/Hledger/Cli/Commands/Files.hs | 2 +- hledger/Hledger/Cli/Commands/Help.hs | 16 +-- hledger/Hledger/Cli/Commands/Import.hs | 2 +- .../Hledger/Cli/Commands/Incomestatement.hs | 2 +- hledger/Hledger/Cli/Commands/Prices.hs | 2 +- hledger/Hledger/Cli/Commands/Print.hs | 2 +- hledger/Hledger/Cli/Commands/Printunique.hs | 2 +- hledger/Hledger/Cli/Commands/Register.hs | 2 +- hledger/Hledger/Cli/Commands/Registermatch.hs | 2 +- hledger/Hledger/Cli/Commands/Rewrite.hs | 2 +- hledger/Hledger/Cli/Commands/Roi.hs | 2 +- hledger/Hledger/Cli/Commands/Stats.hs | 2 +- hledger/Hledger/Cli/Commands/Tags.hs | 2 +- hledger/Hledger/Cli/Main.hs | 18 +-- hledger/hledger.cabal | 6 +- hledger/package.yaml | 1 - 30 files changed, 111 insertions(+), 121 deletions(-) diff --git a/hledger-lib/Hledger/Utils.hs b/hledger-lib/Hledger/Utils.hs index 7a0043fce..be78fa344 100644 --- a/hledger-lib/Hledger/Utils.hs +++ b/hledger-lib/Hledger/Utils.hs @@ -37,18 +37,18 @@ where import Control.Monad (liftM, when) -- import Data.Char import Data.Default -import Data.FileEmbed (makeRelativeToProject, embedFile) +import Data.FileEmbed (makeRelativeToProject, embedStringFile) import Data.List -- import Data.Maybe -- import Data.PPrint -import Data.String.Here (hereFile) +-- import Data.String.Here (hereFile) import Data.Text (Text) import qualified Data.Text.IO as T import Data.Time.Clock import Data.Time.LocalTime -- import Data.Text (Text) -- 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 System.Directory (getHomeDirectory) import System.FilePath((), isRelative) @@ -225,16 +225,16 @@ mapM' :: Monad f => (a -> f b) -> [a] -> f [b] mapM' f = sequence' . map f -- | 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 ? -hereFileRelative :: FilePath -> Q Exp -hereFileRelative f = makeRelativeToProject f >>= hereFileExp - where - QuasiQuoter{quoteExp=hereFileExp} = hereFile +embedFileRelative :: FilePath -> Q Exp +embedFileRelative f = makeRelativeToProject f >>= embedStringFile + +-- -- | 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_Text diff --git a/hledger-lib/hledger-lib.cabal b/hledger-lib/hledger-lib.cabal index 1877103af..840643d0c 100644 --- a/hledger-lib/hledger-lib.cabal +++ b/hledger-lib/hledger-lib.cabal @@ -4,7 +4,7 @@ cabal-version: 1.12 -- -- see: https://github.com/sol/hpack -- --- hash: c17b44c345a89a13650ca3efcba7d7e8311e9312acfd08dff5f2716e70ca29d7 +-- hash: 25ebf00dbf3312c8ce9cef75a4e0dbc04608eca66a179fb6fdc92d9d5e1c3b54 name: hledger-lib version: 1.13 @@ -124,7 +124,6 @@ library , file-embed >=0.0.10 , filepath , hashtables >=1.2.3.1 - , here , megaparsec >=7.0.0 && <8 , mtl , mtl-compat @@ -227,7 +226,6 @@ test-suite doctests , file-embed >=0.0.10 , filepath , hashtables >=1.2.3.1 - , here , megaparsec >=7.0.0 && <8 , mtl , mtl-compat @@ -329,7 +327,6 @@ test-suite easytests , file-embed >=0.0.10 , filepath , hashtables >=1.2.3.1 - , here , hledger-lib , megaparsec >=7.0.0 && <8 , mtl diff --git a/hledger-lib/package.yaml b/hledger-lib/package.yaml index e85c8e843..6f663f22a 100644 --- a/hledger-lib/package.yaml +++ b/hledger-lib/package.yaml @@ -58,7 +58,6 @@ dependencies: - file-embed >=0.0.10 - filepath - hashtables >=1.2.3.1 -- here - megaparsec >=7.0.0 && <8 - mtl - mtl-compat diff --git a/hledger/Hledger/Cli/Commands.hs b/hledger/Hledger/Cli/Commands.hs index 95337b67b..46f4f8190 100644 --- a/hledger/Hledger/Cli/Commands.hs +++ b/hledger/Hledger/Cli/Commands.hs @@ -47,7 +47,6 @@ import Data.List #if !(MIN_VERSION_base(4,11,0)) import Data.Monoid ((<>)) #endif -import Data.String.Here import Data.Text (Text) import qualified Data.Text as T import Data.Time.Calendar @@ -132,63 +131,63 @@ builtinCommands = [ -- TODO: generate more of this automatically. -- commandsList :: String -commandsList = [here| -------------------------------------------------------------------------------- -PROGVERSION -Usage: hledger COMMAND [OPTIONS] [-- ADDONCMDOPTIONS] -Commands (+ addons found in $PATH): - -Data entry (these commands modify the journal file): - add add transactions using guided prompts -+iadd add transactions using curses ui - import add any new transactions from other files (eg csv) - -Data management: -+autosync download/deduplicate/convert OFX data -+check check more powerful balance assertions - check-dates check transactions are ordered by date - check-dupes check for accounts with the same leaf name - close (equity) generate balance-resetting transactions -+diff compare account transactions in two journal files -+interest generate interest transactions - rewrite generate automated postings/diffs (old, use --auto) - -Financial reports: - balancesheet (bs) show assets, liabilities and net worth - balancesheetequity (bse) show assets, liabilities and equity - cashflow (cf) show changes in liquid assets - incomestatement (is) show revenues and expenses -+irr calculate internal rate of return (old, use roi) - roi show return on investments - -Low-level reports: - accounts (a) show account names - activity show postings-per-interval bar charts - balance (b, bal) show balance changes/end balances/budgets in accounts - files show input file paths - prices show market price records - print (p, txns) show transactions (journal entries) - print-unique show only transactions with unique descriptions - register (r, reg) show postings in one or more accounts & running total - register-match show a recent posting that best matches a description - stats show journal statistics - tags show tag names - test run self tests - -Alternate user interfaces: -+ui run curses ui -+web run web ui -+api run http api server - -Other: -OTHER -Help: - (no arguments) show this commands list - -h show general flags - COMMAND -h show flags & docs for COMMAND - help [MANUAL] show hledger manuals in various formats - -|] +commandsList = unlines [ + "-------------------------------------------------------------------------------" + ,"PROGVERSION" + ,"Usage: hledger COMMAND [OPTIONS] [-- ADDONCMDOPTIONS]" + ,"Commands (+ addons found in $PATH):" + ,"" + ,"Data entry (these commands modify the journal file):" + ," add add transactions using guided prompts" + ,"+iadd add transactions using curses ui" + ," import add any new transactions from other files (eg csv)" + ,"" + ,"Data management:" + ,"+autosync download/deduplicate/convert OFX data" + ,"+check check more powerful balance assertions" + ," check-dates check transactions are ordered by date" + ," check-dupes check for accounts with the same leaf name" + ," close (equity) generate balance-resetting transactions" + ,"+diff compare account transactions in two journal files" + ,"+interest generate interest transactions" + ," rewrite generate automated postings/diffs (old, use --auto)" + ,"" + ,"Financial reports:" + ," balancesheet (bs) show assets, liabilities and net worth" + ," balancesheetequity (bse) show assets, liabilities and equity" + ," cashflow (cf) show changes in liquid assets" + ," incomestatement (is) show revenues and expenses" + ,"+irr calculate internal rate of return (old, use roi)" + ," roi show return on investments" + ,"" + ,"Low-level reports:" + ," accounts (a) show account names" + ," activity show postings-per-interval bar charts" + ," balance (b, bal) show balance changes/end balances/budgets in accounts" + ," files show input file paths" + ," prices show market price records" + ," print (p, txns) show transactions (journal entries)" + ," print-unique show only transactions with unique descriptions" + ," register (r, reg) show postings in one or more accounts & running total" + ," register-match show a recent posting that best matches a description" + ," stats show journal statistics" + ," tags show tag names" + ," test run self tests" + ,"" + ,"Alternate user interfaces:" + ,"+ui run curses ui" + ,"+web run web ui" + ,"+api run http api server" + ,"" + ,"Other:" + ,"OTHER" + ,"Help:" + ," (no arguments) show this commands list" + ," -h show general flags" + ," COMMAND -h show flags & docs for COMMAND" + ," help [MANUAL] show hledger manuals in various formats" + ,"" + ] -- commands show brief commands list -- edit open a text editor on some part of the journal -- 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. testmode = hledgerCommandMode - $(hereFileRelative "Hledger/Cli/Commands/Test.txt") + $(embedFileRelative "Hledger/Cli/Commands/Test.txt") [] [generalflagsgroup3] [] diff --git a/hledger/Hledger/Cli/Commands/Accounts.hs b/hledger/Hledger/Cli/Commands/Accounts.hs index 4a1cb31a3..c86ccf31d 100644 --- a/hledger/Hledger/Cli/Commands/Accounts.hs +++ b/hledger/Hledger/Cli/Commands/Accounts.hs @@ -35,7 +35,7 @@ import Hledger.Cli.CliOptions -- | Command line options for this command. 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 ["used"] (\opts -> setboolopt "used" opts) "show account names referenced by transactions" ,flagNone ["tree"] (\opts -> setboolopt "tree" opts) "show short account names, as a tree" diff --git a/hledger/Hledger/Cli/Commands/Activity.hs b/hledger/Hledger/Cli/Commands/Activity.hs index d3d0311ff..5ba092454 100644 --- a/hledger/Hledger/Cli/Commands/Activity.hs +++ b/hledger/Hledger/Cli/Commands/Activity.hs @@ -20,7 +20,7 @@ import Prelude hiding (putStr) import Hledger.Utils.UTF8IOCompat (putStr) activitymode = hledgerCommandMode - $(hereFileRelative "Hledger/Cli/Commands/Activity.txt") + $(embedFileRelative "Hledger/Cli/Commands/Activity.txt") [] [generalflagsgroup1] [] diff --git a/hledger/Hledger/Cli/Commands/Add.hs b/hledger/Hledger/Cli/Commands/Add.hs index 93fa822c6..4e08e8021 100644 --- a/hledger/Hledger/Cli/Commands/Add.hs +++ b/hledger/Hledger/Cli/Commands/Add.hs @@ -48,7 +48,7 @@ import Hledger.Cli.Commands.Register (postingsReportAsText) 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"] [generalflagsgroup2] [] diff --git a/hledger/Hledger/Cli/Commands/Balance.hs b/hledger/Hledger/Cli/Commands/Balance.hs index 406e07866..862b1c2cd 100644 --- a/hledger/Hledger/Cli/Commands/Balance.hs +++ b/hledger/Hledger/Cli/Commands/Balance.hs @@ -270,7 +270,7 @@ import Hledger.Read.CsvReader (CSV, printCSV) -- | Command line options for this command. balancemode = hledgerCommandMode - $(hereFileRelative "Hledger/Cli/Commands/Balance.txt") + $(embedFileRelative "Hledger/Cli/Commands/Balance.txt") ([flagNone ["change"] (\opts -> setboolopt "change" opts) "show balance change in each period (default)" ,flagNone ["cumulative"] (\opts -> setboolopt "cumulative" opts) diff --git a/hledger/Hledger/Cli/Commands/Balancesheet.hs b/hledger/Hledger/Cli/Commands/Balancesheet.hs index 1770ed026..6c2ddccbf 100644 --- a/hledger/Hledger/Cli/Commands/Balancesheet.hs +++ b/hledger/Hledger/Cli/Commands/Balancesheet.hs @@ -18,7 +18,7 @@ import Hledger.Cli.CliOptions import Hledger.Cli.CompoundBalanceCommand balancesheetSpec = CompoundBalanceCommandSpec { - cbcdoc = ($(hereFileRelative "Hledger/Cli/Commands/Balancesheet.txt")), + cbcdoc = ($(embedFileRelative "Hledger/Cli/Commands/Balancesheet.txt")), cbctitle = "Balance Sheet", cbcqueries = [ CBCSubreportSpec{ diff --git a/hledger/Hledger/Cli/Commands/Balancesheetequity.hs b/hledger/Hledger/Cli/Commands/Balancesheetequity.hs index 603c43137..b20e42f7b 100644 --- a/hledger/Hledger/Cli/Commands/Balancesheetequity.hs +++ b/hledger/Hledger/Cli/Commands/Balancesheetequity.hs @@ -18,7 +18,7 @@ import Hledger.Cli.CliOptions import Hledger.Cli.CompoundBalanceCommand balancesheetequitySpec = CompoundBalanceCommandSpec { - cbcdoc = ($(hereFileRelative "Hledger/Cli/Commands/Balancesheetequity.txt")), + cbcdoc = ($(embedFileRelative "Hledger/Cli/Commands/Balancesheetequity.txt")), cbctitle = "Balance Sheet With Equity", cbcqueries = [ CBCSubreportSpec{ diff --git a/hledger/Hledger/Cli/Commands/Cashflow.hs b/hledger/Hledger/Cli/Commands/Cashflow.hs index b45f58977..0925242b8 100644 --- a/hledger/Hledger/Cli/Commands/Cashflow.hs +++ b/hledger/Hledger/Cli/Commands/Cashflow.hs @@ -21,7 +21,7 @@ import Hledger.Cli.CliOptions import Hledger.Cli.CompoundBalanceCommand cashflowSpec = CompoundBalanceCommandSpec { - cbcdoc = ($(hereFileRelative "Hledger/Cli/Commands/Cashflow.txt")), + cbcdoc = ($(embedFileRelative "Hledger/Cli/Commands/Cashflow.txt")), cbctitle = "Cashflow Statement", cbcqueries = [ CBCSubreportSpec{ diff --git a/hledger/Hledger/Cli/Commands/Checkdates.hs b/hledger/Hledger/Cli/Commands/Checkdates.hs index ab313bbf7..c08eeefdd 100755 --- a/hledger/Hledger/Cli/Commands/Checkdates.hs +++ b/hledger/Hledger/Cli/Commands/Checkdates.hs @@ -13,7 +13,7 @@ import Text.Printf checkdatesmode :: Mode RawOpts checkdatesmode = hledgerCommandMode - ($(hereFileRelative "Hledger/Cli/Commands/Checkdates.txt")) + ($(embedFileRelative "Hledger/Cli/Commands/Checkdates.txt")) [flagNone ["strict"] (\opts -> setboolopt "strict" opts) "makes date comparing strict"] [generalflagsgroup1] [] diff --git a/hledger/Hledger/Cli/Commands/Checkdupes.hs b/hledger/Hledger/Cli/Commands/Checkdupes.hs index 5c03a0cbf..2e4fd2c9f 100755 --- a/hledger/Hledger/Cli/Commands/Checkdupes.hs +++ b/hledger/Hledger/Cli/Commands/Checkdupes.hs @@ -16,7 +16,7 @@ import Text.Printf checkdupesmode :: Mode RawOpts checkdupesmode = hledgerCommandMode - ($(hereFileRelative "Hledger/Cli/Commands/Checkdupes.txt")) + ($(embedFileRelative "Hledger/Cli/Commands/Checkdupes.txt")) [] [generalflagsgroup1] [] diff --git a/hledger/Hledger/Cli/Commands/Close.hs b/hledger/Hledger/Cli/Commands/Close.hs index 3b9ced6e4..ee6ace556 100755 --- a/hledger/Hledger/Cli/Commands/Close.hs +++ b/hledger/Hledger/Cli/Commands/Close.hs @@ -16,7 +16,7 @@ import Hledger import Hledger.Cli.CliOptions 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 ["closing"] (\opts -> setboolopt "closing" opts) "show just closing transaction" ] diff --git a/hledger/Hledger/Cli/Commands/Files.hs b/hledger/Hledger/Cli/Commands/Files.hs index 0fcfdd228..2c96b6a4b 100644 --- a/hledger/Hledger/Cli/Commands/Files.hs +++ b/hledger/Hledger/Cli/Commands/Files.hs @@ -23,7 +23,7 @@ import Hledger.Cli.CliOptions -- | Command line options for this command. filesmode = hledgerCommandMode - ($(hereFileRelative "Hledger/Cli/Commands/Files.txt")) + ($(embedFileRelative "Hledger/Cli/Commands/Files.txt")) [] [generalflagsgroup2] [] diff --git a/hledger/Hledger/Cli/Commands/Help.hs b/hledger/Hledger/Cli/Commands/Help.hs index 99a38adda..936a1b06e 100644 --- a/hledger/Hledger/Cli/Commands/Help.hs +++ b/hledger/Hledger/Cli/Commands/Help.hs @@ -20,7 +20,6 @@ module Hledger.Cli.Commands.Help ( import Prelude () import "base-compat-batteries" Prelude.Compat import Data.Char -import Data.String.Here import Data.List import Data.Maybe import Safe @@ -28,7 +27,7 @@ import System.Console.CmdArgs.Explicit import System.Environment import System.IO -import Hledger.Utils (hereFileRelative) +import Hledger.Utils (embedFileRelative) import Hledger.Data.RawOptions import Hledger.Data.Types import Hledger.Cli.CliOptions @@ -36,7 +35,7 @@ import Hledger.Cli.DocFiles --import Hledger.Utils.Debug helpmode = hledgerCommandMode - ($(hereFileRelative "Hledger/Cli/Commands/Help.txt")) + ($(embedFileRelative "Hledger/Cli/Commands/Help.txt")) [flagNone ["info"] (setboolopt "info") "show the manual with info" ,flagNone ["man"] (setboolopt "man") "show the manual with man" ,flagNone ["pager"] (setboolopt "pager") "show the manual with $PAGER or less" @@ -74,9 +73,10 @@ help' opts _ = do | pagerprog `elem` exes = pager | otherwise = cat case topic of - Nothing -> putStrLn $ [here| -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, -or type "hledger help -h" to see options. Manuals available: -|] ++ "\n " ++ intercalate " " docTopics + Nothing -> putStrLn $ unlines [ + "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," + ,"or type \"hledger help -h\" to see options. Manuals available:" + ] + ++ "\n " ++ intercalate " " docTopics Just t -> viewer t diff --git a/hledger/Hledger/Cli/Commands/Import.hs b/hledger/Hledger/Cli/Commands/Import.hs index b589c2614..4363190c8 100755 --- a/hledger/Hledger/Cli/Commands/Import.hs +++ b/hledger/Hledger/Cli/Commands/Import.hs @@ -18,7 +18,7 @@ import System.Console.CmdArgs.Explicit import Text.Printf 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"] [generalflagsgroup1] [] diff --git a/hledger/Hledger/Cli/Commands/Incomestatement.hs b/hledger/Hledger/Cli/Commands/Incomestatement.hs index 8819a0985..58f2dc742 100644 --- a/hledger/Hledger/Cli/Commands/Incomestatement.hs +++ b/hledger/Hledger/Cli/Commands/Incomestatement.hs @@ -17,7 +17,7 @@ import Hledger.Cli.CliOptions import Hledger.Cli.CompoundBalanceCommand incomestatementSpec = CompoundBalanceCommandSpec { - cbcdoc = ($(hereFileRelative "Hledger/Cli/Commands/Incomestatement.txt")), + cbcdoc = ($(embedFileRelative "Hledger/Cli/Commands/Incomestatement.txt")), cbctitle = "Income Statement", cbcqueries = [ CBCSubreportSpec{ diff --git a/hledger/Hledger/Cli/Commands/Prices.hs b/hledger/Hledger/Cli/Commands/Prices.hs index a492a7630..3aa0d84d2 100755 --- a/hledger/Hledger/Cli/Commands/Prices.hs +++ b/hledger/Hledger/Cli/Commands/Prices.hs @@ -15,7 +15,7 @@ import Hledger.Cli.CliOptions import System.Console.CmdArgs.Explicit pricesmode = hledgerCommandMode - ($(hereFileRelative "Hledger/Cli/Commands/Prices.txt")) + ($(embedFileRelative "Hledger/Cli/Commands/Prices.txt")) [flagNone ["costs"] (setboolopt "costs") "print transaction prices from postings" ,flagNone ["inverted-costs"] (setboolopt "inverted-costs") "print transaction inverted prices from postings also"] [generalflagsgroup1] diff --git a/hledger/Hledger/Cli/Commands/Print.hs b/hledger/Hledger/Cli/Commands/Print.hs index 04a817ca5..a3fa320a8 100644 --- a/hledger/Hledger/Cli/Commands/Print.hs +++ b/hledger/Hledger/Cli/Commands/Print.hs @@ -27,7 +27,7 @@ import Hledger.Cli.Commands.Add ( transactionsSimilarTo ) printmode = hledgerCommandMode - ($(hereFileRelative "Hledger/Cli/Commands/Print.txt")) + ($(embedFileRelative "Hledger/Cli/Commands/Print.txt")) [let arg = "STR" in 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") diff --git a/hledger/Hledger/Cli/Commands/Printunique.hs b/hledger/Hledger/Cli/Commands/Printunique.hs index e139c88c3..205541804 100755 --- a/hledger/Hledger/Cli/Commands/Printunique.hs +++ b/hledger/Hledger/Cli/Commands/Printunique.hs @@ -13,7 +13,7 @@ import Hledger.Cli.CliOptions import Hledger.Cli.Commands.Print printuniquemode = hledgerCommandMode - ($(hereFileRelative "Hledger/Cli/Commands/Printunique.txt")) + ($(embedFileRelative "Hledger/Cli/Commands/Printunique.txt")) [] [generalflagsgroup1] [] diff --git a/hledger/Hledger/Cli/Commands/Register.hs b/hledger/Hledger/Cli/Commands/Register.hs index d9593b4a2..19284bf2d 100644 --- a/hledger/Hledger/Cli/Commands/Register.hs +++ b/hledger/Hledger/Cli/Commands/Register.hs @@ -28,7 +28,7 @@ import Hledger.Cli.CliOptions import Hledger.Cli.Utils registermode = hledgerCommandMode - ($(hereFileRelative "Hledger/Cli/Commands/Register.txt")) + ($(embedFileRelative "Hledger/Cli/Commands/Register.txt")) [flagNone ["cumulative"] (\opts -> setboolopt "change" opts) "show running total from report start date (default)" ,flagNone ["historical","H"] (\opts -> setboolopt "historical" opts) diff --git a/hledger/Hledger/Cli/Commands/Registermatch.hs b/hledger/Hledger/Cli/Commands/Registermatch.hs index d2e5a535d..3b4d9bd51 100755 --- a/hledger/Hledger/Cli/Commands/Registermatch.hs +++ b/hledger/Hledger/Cli/Commands/Registermatch.hs @@ -15,7 +15,7 @@ import Hledger.Cli.CliOptions import Hledger.Cli.Commands.Register registermatchmode = hledgerCommandMode - ($(hereFileRelative "Hledger/Cli/Commands/Registermatch.txt")) + ($(embedFileRelative "Hledger/Cli/Commands/Registermatch.txt")) [] [generalflagsgroup1] [] diff --git a/hledger/Hledger/Cli/Commands/Rewrite.hs b/hledger/Hledger/Cli/Commands/Rewrite.hs index feeb02201..959c42746 100755 --- a/hledger/Hledger/Cli/Commands/Rewrite.hs +++ b/hledger/Hledger/Cli/Commands/Rewrite.hs @@ -23,7 +23,7 @@ import Text.Megaparsec import qualified Data.Algorithm.Diff as D 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'" "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" diff --git a/hledger/Hledger/Cli/Commands/Roi.hs b/hledger/Hledger/Cli/Commands/Roi.hs index 84b4c18a2..326345d0a 100644 --- a/hledger/Hledger/Cli/Commands/Roi.hs +++ b/hledger/Hledger/Cli/Commands/Roi.hs @@ -30,7 +30,7 @@ import Hledger.Cli.CliOptions 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" ,flagReq ["investment"] (\s opts -> Right $ setopt "investment" s opts) "QUERY" "query to select your investment transactions" diff --git a/hledger/Hledger/Cli/Commands/Stats.hs b/hledger/Hledger/Cli/Commands/Stats.hs index a7f39f780..3a844b6c1 100644 --- a/hledger/Hledger/Cli/Commands/Stats.hs +++ b/hledger/Hledger/Cli/Commands/Stats.hs @@ -31,7 +31,7 @@ import Hledger.Cli.Utils (writeOutput) 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." ] [generalflagsgroup1] diff --git a/hledger/Hledger/Cli/Commands/Tags.hs b/hledger/Hledger/Cli/Commands/Tags.hs index d0d94be71..edd7bfed1 100755 --- a/hledger/Hledger/Cli/Commands/Tags.hs +++ b/hledger/Hledger/Cli/Commands/Tags.hs @@ -14,7 +14,7 @@ import Hledger import Hledger.Cli.CliOptions tagsmode = hledgerCommandMode - ($(hereFileRelative "Hledger/Cli/Commands/Tags.txt")) + ($(embedFileRelative "Hledger/Cli/Commands/Tags.txt")) [] -- [flagNone ["strict"] (\opts -> setboolopt "strict" opts) "makes date comparing strict"] -- [generalflagsgroup1] [] diff --git a/hledger/Hledger/Cli/Main.hs b/hledger/Hledger/Cli/Main.hs index d737e1afb..b23086153 100644 --- a/hledger/Hledger/Cli/Main.hs +++ b/hledger/Hledger/Cli/Main.hs @@ -42,7 +42,6 @@ module Hledger.Cli.Main where import Data.Char (isDigit) import Data.List -import Data.String.Here import Safe import System.Console.CmdArgs.Explicit as C import System.Environment @@ -83,14 +82,15 @@ mainmode addons = defMode { [detailedversionflag] -- ++ inputflags -- included here so they'll not raise a confusing error if present with no COMMAND } - ,modeHelpSuffix = lines $ regexReplace "PROGNAME" progname [here|Examples: -PROGNAME list commands -PROGNAME CMD [--] [OPTS] [ARGS] run a command (use -- with addon commands) -PROGNAME-CMD [OPTS] [ARGS] or run addon commands directly -PROGNAME -h show general usage -PROGNAME CMD -h show command usage -PROGNAME help [MANUAL] show any of the hledger manuals in various formats -|] + ,modeHelpSuffix = map (regexReplace "PROGNAME" progname) [ + "Examples:" + ,"PROGNAME list commands" + ,"PROGNAME CMD [--] [OPTS] [ARGS] run a command (use -- with addon commands)" + ,"PROGNAME-CMD [OPTS] [ARGS] or run addon commands directly" + ,"PROGNAME -h show general usage" + ,"PROGNAME CMD -h show command usage" + ,"PROGNAME help [MANUAL] show any of the hledger manuals in various formats" + ] } -- | Let's go! diff --git a/hledger/hledger.cabal b/hledger/hledger.cabal index 9ccf32c10..038df351a 100644 --- a/hledger/hledger.cabal +++ b/hledger/hledger.cabal @@ -4,7 +4,7 @@ cabal-version: 1.12 -- -- see: https://github.com/sol/hpack -- --- hash: 0f31726cb805b74d59400bb1d7502bb6c6c7f01eb41ac0272c4da6a8d94144b2 +-- hash: 23ad53c1065d2d491ad11197683363d92136d6117de4ea6cc258865b82b5fc52 name: hledger version: 1.13 @@ -152,7 +152,6 @@ library , filepath , hashable >=1.2.4 , haskeline >=0.6 - , here , hledger-lib >=1.13 && <1.14 , lucid , math-functions >=0.2.0.0 @@ -202,7 +201,6 @@ executable hledger , easytest , filepath , haskeline >=0.6 - , here , hledger , hledger-lib >=1.13 && <1.14 , math-functions >=0.2.0.0 @@ -255,7 +253,6 @@ test-suite test , easytest , filepath , haskeline >=0.6 - , here , hledger , hledger-lib >=1.13 && <1.14 , math-functions >=0.2.0.0 @@ -308,7 +305,6 @@ benchmark bench , easytest , filepath , haskeline >=0.6 - , here , hledger , hledger-lib >=1.13 && <1.14 , html diff --git a/hledger/package.yaml b/hledger/package.yaml index 5963302e1..2794b5d41 100644 --- a/hledger/package.yaml +++ b/hledger/package.yaml @@ -116,7 +116,6 @@ dependencies: - easytest - filepath - haskeline >=0.6 -- here - megaparsec >=7.0.0 && <8 - mtl - mtl-compat