Revision 7dc27988 src/Ganeti/DataCollectors/CLI.hs

b/src/Ganeti/DataCollectors/CLI.hs
36 36
  , oShowComp
37 37
  , oDrbdPairing
38 38
  , oDrbdStatus
39
  , oNode
40
  , oConfdAddr
41
  , oConfdPort
39 42
  , genericOptions
40 43
  ) where
41 44

  
......
43 46

  
44 47
import Ganeti.BasicTypes
45 48
import Ganeti.Common as Common
49
import Ganeti.Utils
50

  
46 51

  
47 52
-- * Data types
48 53

  
......
55 60
                                     -- status information
56 61
  , optDrbdPairing :: Maybe FilePath -- ^ Path to the file containing pairings
57 62
                                     -- between instances and DRBD minors
63
  , optNode        :: Maybe String   -- ^ Info are requested for this node
64
  , optConfdAddr   :: Maybe String   -- ^ IP address of the Confd server
65
  , optConfdPort   :: Maybe Int      -- ^ The port of the Confd server to
66
                                     -- connect to
58 67
  } deriving Show
59 68

  
60 69
-- | Default values for the command line options.
......
65 74
  , optShowVer     = False
66 75
  , optDrbdStatus  = Nothing
67 76
  , optDrbdPairing = Nothing
77
  , optNode        = Nothing
78
  , optConfdAddr   = Nothing
79
  , optConfdPort   = Nothing
68 80
  }
69 81

  
70 82
-- | Abbreviation for the option type.
......
93 105
      "the DRBD status FILE",
94 106
    OptComplFile)
95 107

  
108
oNode :: OptType
109
oNode =
110
  ( Option "n" ["node"]
111
      (ReqArg (\ n o -> Ok o { optNode = Just n }) "NODE")
112
      "the FQDN of the NODE about which information is requested",
113
    OptComplFile)
114

  
115
oConfdAddr :: OptType
116
oConfdAddr =
117
  ( Option "a" ["address"]
118
      (ReqArg (\ a o -> Ok o { optConfdAddr = Just a }) "IP_ADDR")
119
      "the IP address of the Confd server to connect to",
120
    OptComplFile)
121

  
122
oConfdPort :: OptType
123
oConfdPort =
124
  (Option "p" ["port"]
125
    (reqWithConversion (tryRead "reading port")
126
      (\port opts -> Ok opts { optConfdPort = Just port }) "PORT")
127
    "Network port of the Confd server to connect to",
128
    OptComplInteger)
129

  
96 130
-- | Generic options.
97 131
genericOptions :: [GenericOptType Options]
98 132
genericOptions =  [ oShowVer

Also available in: Unified diff