Revision d78970ba src/Ganeti/DataCollectors/CLI.hs

b/src/Ganeti/DataCollectors/CLI.hs
34 34
  , oShowHelp
35 35
  , oShowVer
36 36
  , oShowComp
37
  , oDrbdPairing
38
  , oDrbdStatus
37 39
  , genericOptions
38 40
  ) where
39 41

  
42
import System.Console.GetOpt
43

  
44
import Ganeti.BasicTypes
40 45
import Ganeti.Common as Common
41 46

  
42 47
-- * Data types
......
46 51
  { optShowHelp    :: Bool           -- ^ Just show the help
47 52
  , optShowComp    :: Bool           -- ^ Just show the completion info
48 53
  , optShowVer     :: Bool           -- ^ Just show the program version
54
  , optDrbdStatus  :: Maybe FilePath -- ^ Path to the file containing DRBD
55
                                     -- status information
56
  , optDrbdPairing :: Maybe FilePath -- ^ Path to the file containing pairings
57
                                     -- between instances and DRBD minors
49 58
  } deriving Show
50 59

  
51 60
-- | Default values for the command line options.
......
54 63
  { optShowHelp    = False
55 64
  , optShowComp    = False
56 65
  , optShowVer     = False
66
  , optDrbdStatus  = Nothing
67
  , optDrbdPairing = Nothing
57 68
  }
58 69

  
59 70
-- | Abbreviation for the option type.
......
68 79
  requestComp o = o { optShowComp = True }
69 80

  
70 81
-- * Command line options
82
oDrbdPairing :: OptType
83
oDrbdPairing =
84
  ( Option "p" ["drbd-pairing"]
85
      (ReqArg (\ f o -> Ok o { optDrbdPairing = Just f}) "FILE")
86
      "the FILE containing pairings between instances and DRBD minors",
87
    OptComplFile)
88

  
89
oDrbdStatus :: OptType
90
oDrbdStatus =
91
  ( Option "s" ["drbd-status"]
92
      (ReqArg (\ f o -> Ok o { optDrbdStatus = Just f }) "FILE")
93
      "the DRBD status FILE",
94
    OptComplFile)
71 95

  
72 96
-- | Generic options.
73 97
genericOptions :: [GenericOptType Options]

Also available in: Unified diff