~ubuntu-branches/ubuntu/trusty/happy/trusty-proposed

« back to all changes in this revision

Viewing changes to glafp-utils/nofib-analyse/CmdLine.hs

  • Committer: Bazaar Package Importer
  • Author(s): Ian Lynagh (wibble)
  • Date: 2006-10-26 22:52:14 UTC
  • mfrom: (1.2.2 upstream) (3.1.1 dapper)
  • Revision ID: james.westby@ubuntu.com-20061026225214-6jmf0n3ykkc9elyw
Tags: 1.16~rc2-1
* New upstream (release candidate) version.
* Removed happy/ prefixes from various paths in debian/rules and
  debian/docs.
* doc/configure generated by autoconf is in the Debian diff.
* Build using cabal:
  * Various debian/rules changes.
  * Create debian/get_version.hs for extracting the version from the cabal
    file.
  * Requires ghc6 >= 6.4.2.
  * No longer tries to detect platform. Closes: #340325, #332979.
  * Removed autotool-dev build-dep.
* Add 'XSLTPROC_OPTS = --nonet' to doc/config.mk.in.
* Remove src/Parser.ly and src/AttrGrammarParser.ly before cleaning so
  the generated files don't get cleaned.
* Set Standards-Version to 3.7.2 (no changes needed).
* Removed PS and DVI stanzas from debian/doc-base as we don't build
  the documentation those ways.
* Removed content-free postinst and prerm.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
-----------------------------------------------------------------------------
2
 
 
3
 
-----------------------------------------------------------------------------
4
 
 
5
 
module CmdLine where
6
 
 
7
 
import GetOpt
8
 
import System
9
 
import IOExts
10
 
 
11
 
-----------------------------------------------------------------------------
12
 
 
13
 
args = unsafePerformIO getArgs
14
 
(flags, other_args, cmdline_errors) = getOpt Permute argInfo args 
15
 
 
16
 
default_tooquick_threshold = 0.2 {- secs -} :: Float
17
 
tooquick_threshold
18
 
 = case [ i | OptIgnoreSmallTimes i <- flags ] of
19
 
        [] -> default_tooquick_threshold
20
 
        (i:_) -> i
21
 
 
22
 
devs   = OptDeviations   `elem` flags
23
 
nodevs = OptNoDeviations `elem` flags
24
 
 
25
 
default_title = "NoFib Results"
26
 
reportTitle = case [ t | OptTitle t <- flags ] of
27
 
        []    -> default_title
28
 
        (t:_) -> t
29
 
 
30
 
data CLIFlags
31
 
  = OptASCIIOutput
32
 
  | OptLaTeXOutput
33
 
  | OptHTMLOutput
34
 
  | OptIgnoreSmallTimes Float
35
 
  | OptDeviations
36
 
  | OptNoDeviations
37
 
  | OptTitle String
38
 
  | OptHelp
39
 
  deriving Eq
40
 
 
41
 
argInfo :: [ OptDescr CLIFlags ]
42
 
argInfo = 
43
 
  [ Option ['?'] ["help"]    (NoArg OptHelp)        
44
 
        "Display this message"
45
 
  , Option ['a'] ["ascii"]   (NoArg OptASCIIOutput) 
46
 
        "Produce ASCII output (default)"
47
 
  , Option ['h'] ["html"]    (NoArg OptHTMLOutput)  
48
 
        "Produce HTML output"
49
 
  , Option ['i'] ["ignore"]  (ReqArg (OptIgnoreSmallTimes . read) "secs")
50
 
        "Ignore runtimes smaller than <secs>"
51
 
  , Option ['d'] ["deviations"] (NoArg OptDeviations)
52
 
        "Display deviations (default)"
53
 
  , Option ['l'] ["latex"]    (NoArg OptLaTeXOutput)  
54
 
        "Produce LaTeX output"
55
 
  , Option ['n'] ["nodeviations"] (NoArg OptNoDeviations)
56
 
        "Hide deviations"
57
 
  , Option ['t'] ["title"] (ReqArg OptTitle "title")
58
 
        "Specify report title"
59
 
  ]
60