{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Hledger.Cli.Commands.Commodities (
commoditiesmode
,commodities
) where
import qualified Data.Set as S
import qualified Data.Text.IO as T
import Hledger
import Hledger.Cli.CliOptions
commoditiesmode :: Mode RawOpts
commoditiesmode = CommandDoc
-> [Flag RawOpts]
-> [(CommandDoc, [Flag RawOpts])]
-> [Flag RawOpts]
-> ([Arg RawOpts], Maybe (Arg RawOpts))
-> Mode RawOpts
hledgerCommandMode
$(embedFileRelative "Hledger/Cli/Commands/Commodities.txt")
[]
[(CommandDoc, [Flag RawOpts])
generalflagsgroup2]
[]
([], forall a. Maybe a
Nothing)
commodities :: CliOpts -> Journal -> IO ()
commodities :: CliOpts -> Journal -> IO ()
commodities CliOpts
_copts =
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ Text -> IO ()
T.putStrLn forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (a -> Bool) -> Set a -> Set a
S.filter (forall a. Eq a => a -> a -> Bool
/= Text
"AUTO") forall b c a. (b -> c) -> (a -> b) -> a -> c
. Journal -> Set Text
journalCommodities