summaryrefslogtreecommitdiff
path: root/lib/Language/Elna/CommandLine.hs
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2024-12-20 15:32:20 +0100
committerEugen Wissner <belka@caraus.de>2024-12-20 15:32:20 +0100
commita1c99103003bfd466c77a369fb3312f922f336d0 (patch)
tree42dc2946a4183f63c90400b71d973023a5fe13aa /lib/Language/Elna/CommandLine.hs
parentfbd08f27078f2e86c7e0ae65fd8d89658c0c34bd (diff)
downloadelna-a1c99103003bfd466c77a369fb3312f922f336d0.tar.gz
Add stage options
Diffstat (limited to 'lib/Language/Elna/CommandLine.hs')
-rw-r--r--lib/Language/Elna/CommandLine.hs48
1 files changed, 0 insertions, 48 deletions
diff --git a/lib/Language/Elna/CommandLine.hs b/lib/Language/Elna/CommandLine.hs
deleted file mode 100644
index 19898e2..0000000
--- a/lib/Language/Elna/CommandLine.hs
+++ /dev/null
@@ -1,48 +0,0 @@
-{- This Source Code Form is subject to the terms of the Mozilla Public License,
- v. 2.0. If a copy of the MPL was not distributed with this file, You can
- obtain one at https://mozilla.org/MPL/2.0/. -}
-
-module Language.Elna.CommandLine
- ( CommandLine(..)
- , commandLine
- , execParser
- ) where
-
-import Options.Applicative
- ( Parser
- , ParserInfo(..)
- , argument
- , execParser
- , fullDesc
- , help
- , helper
- , info
- , long
- , metavar
- , optional
- , progDesc
- , short
- , str
- , strOption
- )
-import Control.Applicative ((<**>))
-
-data CommandLine = CommandLine
- { input :: FilePath
- , output :: Maybe FilePath
- } deriving (Eq, Show)
-
-parser :: Parser CommandLine
-parser = CommandLine
- <$> argument str inFile
- <*> optional (strOption outFile)
- where
- inFile = metavar "INFILE" <> help "Input file."
- outFile = long "output"
- <> short 'o'
- <> metavar "OUTFILE"
- <> help "Output file."
-
-commandLine :: ParserInfo CommandLine
-commandLine = info (parser <**> helper)
- $ fullDesc <> progDesc "Elna compiler."