Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More code stubs while adding cmd args support (rudimentary)
- Loading branch information
Mihai Maruseac
committed
Feb 10, 2011
1 parent
d5f5b42
commit f489f57
Showing
4 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{- | ||
This module contains the splitting part of the HaCoTeB project. | ||
-} | ||
|
||
module HaCoTeB.Splitter where | ||
|
||
test = 42 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|