hledger/hledger/Hledger/Cli/Commands/Commodities.hs
Stephen Morgan 4609e79f2c lib,cli,ui,web: A number of AccountName and Journal functions which are
supposed to produce unique sorted use Sets internally to be slightly
more efficient. There is also a new function journalCommodities.
2021-03-23 11:26:30 -07:00

33 lines
656 B
Haskell

{-|
The @commodities@ command lists commodity/currency symbols.
-}
{-# 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
-- | Command line options for this command.
commoditiesmode = hledgerCommandMode
$(embedFileRelative "Hledger/Cli/Commands/Commodities.txt")
[]
[generalflagsgroup2]
[]
([], Nothing)
commodities :: CliOpts -> Journal -> IO ()
commodities _copts =
mapM_ T.putStrLn . S.filter (/= "AUTO") . journalCommodities