File: CustomOption.hs

package info (click to toggle)
haskell-getopt-generics 0.13.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 256 kB
  • sloc: haskell: 1,644; makefile: 3
file content (21 lines) | stat: -rw-r--r-- 384 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{-# LANGUAGE DeriveDataTypeable #-}

module CustomOption where

import WithCli

data File = File FilePath
  deriving (Show, Typeable)

instance Argument File where
  argumentType Proxy = "custom-file-type"
  parseArgument f = Just (File f)

instance HasArguments File where
  argumentsParser = atomicArgumentsParser

main :: IO ()
main = withCli run

run :: File -> IO ()
run = print