diff --git a/hledger/Hledger/Cli/Script.hs b/hledger/Hledger/Cli/Script.hs new file mode 100644 index 000000000..0985177d8 --- /dev/null +++ b/hledger/Hledger/Cli/Script.hs @@ -0,0 +1,33 @@ +{-| +A convenient module to import in hledger scripts, +aiming to provide the most useful imports and reduce boilerplate. +|-} + +{-# LANGUAGE PackageImports #-} + +module Hledger.Cli.Script +( module Script +) +where + +import Control.Monad as Script +import Data.Either as Script +import Data.List as Script +import Data.Maybe as Script +import Data.Ord as Script +-- import Data.String.QQ (s) -- https://github.com/audreyt/string-qq/pull/3 +import Data.Time as Script +import Text.Printf as Script hiding (formatString) +import "text" Data.Text as Script (Text, pack, unpack) + -- can't re-export much of Data.Text & Data.Text.IO, they need to be qualified +import Safe as Script hiding (at) +-- import qualified System.Console.CmdArgs.Explicit as Script +import System.Directory as Script +import System.Environment as Script +import System.Exit as Script +import System.FilePath as Script +import System.Process as Script + +import Hledger as Script +import Hledger.Cli as Script +import Hledger.Cli.Main as Script (argsToCliOpts) diff --git a/hledger/package.yaml b/hledger/package.yaml index 09283f3bc..6fab9757f 100644 --- a/hledger/package.yaml +++ b/hledger/package.yaml @@ -146,6 +146,7 @@ library: - Hledger.Cli.DocFiles - Hledger.Cli.Utils - Hledger.Cli.Anon + - Hledger.Cli.Script - Hledger.Cli.Version - Hledger.Cli.Commands - Hledger.Cli.Commands.Accounts