Revision 2e6ef129 htools/Ganeti/Common.hs

b/htools/Ganeti/Common.hs
31 31
  , StandardOptions(..)
32 32
  , OptCompletion(..)
33 33
  , ArgCompletion(..)
34
  , PersonalityList
34 35
  , optComplYesNo
35 36
  , oShowHelp
36 37
  , oShowVer
......
86 87
data ArgCompletion = ArgCompletion OptCompletion Int (Maybe Int)
87 88
                     deriving (Show, Eq)
88 89

  
90
-- | A personality definition.
91
type Personality a = ( a -> [String] -> IO () -- The main function
92
                     , IO [GenericOptType a]  -- The options
93
                     , [ArgCompletion]        -- The description of args
94
                     )
95

  
96
-- | Personality lists type, common across all binaries that expose
97
-- multiple personalities.
98
type PersonalityList  a = [(String, Personality a)]
99

  
89 100
-- | Yes\/no choices completion.
90 101
optComplYesNo :: OptCompletion
91 102
optComplYesNo = OptComplChoices ["yes", "no"]

Also available in: Unified diff