Revision 75d1edf8 hn1.hs

b/hn1.hs
40 40
    , optShowHelp    :: Bool     -- ^ Just show the help
41 41
    } deriving Show
42 42

  
43
instance CLI.CLIOptions Options where
44
    showVersion = optShowVer
45
    showHelp    = optShowHelp
46

  
43 47
-- | Default values for the command line options.
44 48
defaultOptions :: Options
45 49
defaultOptions    = Options
......
130 134
main = do
131 135
  cmd_args <- System.getArgs
132 136
  (opts, args) <- CLI.parseOpts cmd_args "hn1" options
133
                  defaultOptions optShowHelp
137
                  defaultOptions
134 138

  
135 139
  unless (null args) $ do
136 140
         hPutStrLn stderr "Error: this program doesn't take any arguments."
137 141
         exitWith $ ExitFailure 1
138 142

  
139
  when (optShowVer opts) $ do
140
         putStr $ CLI.showVersion "hn1"
141
         exitWith ExitSuccess
142

  
143 143
  (env_node, env_inst) <- CLI.parseEnv ()
144 144
  let nodef = if optNodeSet opts then optNodef opts
145 145
              else env_node

Also available in: Unified diff