Skip to content

Commit

Permalink
More code stubs while adding cmd args support (rudimentary)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihai Maruseac committed Feb 10, 2011
1 parent d5f5b42 commit f489f57
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/HaCoTeB.hs
@@ -0,0 +1,13 @@
{-
This is an umbrella module reexporting the HaCoTeB.* submodules to allow a
more simple import in other programs using this module (if any).
-}

module HaCoTeB
( module HaCoTeB.Options
, module HaCoTeB.Splitter
) where

import HaCoTeB.Options
import HaCoTeB.Splitter

33 changes: 33 additions & 0 deletions src/HaCoTeB/Options.hs
@@ -0,0 +1,33 @@
{-
This module contains the command line arguments that can be given to HaCoTeB.
If someone will want to extend them for another project which uses HaCoTeB she
can freely do so either here or by importing this module and constructing a
more general CmdArgs data type structure.
-}

{-# LANGUAGE DeriveDataTypeable #-}

module HaCoTeB.Options
where

import System.Console.CmdArgs

{-
Command line arguments as a data type.
-}
data Options = Options
{ files :: [FilePath]
} deriving (Show, Data, Typeable)

{-
Command line arguments for the entire HaCoTeB (all stages of pipeline).
-}
options = Options
{ files = def &= args &= typ "FILES"
}
&= summary "HaCoTeB (C) Mihai Maruseac 2011"
&= help ("Constructs one simple output file from an input file containing"
++ " text and code markup. Useful for blogging or other activities.")
&= details ["Details: TODO"]
&= program "hctb"

8 changes: 8 additions & 0 deletions src/HaCoTeB/Splitter.hs
@@ -0,0 +1,8 @@
{-
This module contains the splitting part of the HaCoTeB project.
-}

module HaCoTeB.Splitter where

test = 42

18 changes: 18 additions & 0 deletions src/Main.hs
@@ -0,0 +1,18 @@
{-
This is the Main module for the HaCoTeB project. It is separated from the
HaCoTeB module to allow for later reuse and to differentiate between the tool
and its usage.
-}

{-# LANGUAGE RecordWildCards #-}

module Main where

import System.Console.CmdArgs

import HaCoTeB

main = do
Options {..} <- cmdArgs options -- as defined in HaCoTeB.Options
print files

0 comments on commit f489f57

Please sign in to comment.