Revision ce207617 htools/Ganeti/Daemon.hs
b/htools/Ganeti/Daemon.hs | ||
---|---|---|
114 | 114 |
-- * Command line options |
115 | 115 |
|
116 | 116 |
oNoDaemonize :: OptType |
117 |
oNoDaemonize = Option "f" ["foreground"] |
|
118 |
(NoArg (\ opts -> Ok opts { optDaemonize = False})) |
|
119 |
"Don't detach from the current terminal" |
|
117 |
oNoDaemonize = |
|
118 |
(Option "f" ["foreground"] |
|
119 |
(NoArg (\ opts -> Ok opts { optDaemonize = False})) |
|
120 |
"Don't detach from the current terminal", |
|
121 |
OptComplNone) |
|
120 | 122 |
|
121 | 123 |
oDebug :: OptType |
122 |
oDebug = Option "d" ["debug"] |
|
123 |
(NoArg (\ opts -> Ok opts { optDebug = True })) |
|
124 |
"Enable debug messages" |
|
124 |
oDebug = |
|
125 |
(Option "d" ["debug"] |
|
126 |
(NoArg (\ opts -> Ok opts { optDebug = True })) |
|
127 |
"Enable debug messages", |
|
128 |
OptComplNone) |
|
125 | 129 |
|
126 | 130 |
oNoUserChecks :: OptType |
127 |
oNoUserChecks = Option "" ["no-user-checks"] |
|
128 |
(NoArg (\ opts -> Ok opts { optNoUserChecks = True })) |
|
129 |
"Ignore user checks" |
|
131 |
oNoUserChecks = |
|
132 |
(Option "" ["no-user-checks"] |
|
133 |
(NoArg (\ opts -> Ok opts { optNoUserChecks = True })) |
|
134 |
"Ignore user checks", |
|
135 |
OptComplNone) |
|
130 | 136 |
|
131 | 137 |
oPort :: Int -> OptType |
132 |
oPort def = Option "p" ["port"] |
|
133 |
(reqWithConversion (tryRead "reading port") |
|
134 |
(\port opts -> Ok opts { optPort = Just port }) "PORT") |
|
135 |
("Network port (default: " ++ show def ++ ")") |
|
138 |
oPort def = |
|
139 |
(Option "p" ["port"] |
|
140 |
(reqWithConversion (tryRead "reading port") |
|
141 |
(\port opts -> Ok opts { optPort = Just port }) "PORT") |
|
142 |
("Network port (default: " ++ show def ++ ")"), |
|
143 |
OptComplNumeric) |
|
136 | 144 |
|
137 | 145 |
oBindAddress :: OptType |
138 |
oBindAddress = Option "b" ["bind"] |
|
139 |
(ReqArg (\addr opts -> Ok opts { optBindAddress = Just addr }) |
|
140 |
"ADDR") |
|
141 |
"Bind address (default depends on cluster configuration)" |
|
146 |
oBindAddress = |
|
147 |
(Option "b" ["bind"] |
|
148 |
(ReqArg (\addr opts -> Ok opts { optBindAddress = Just addr }) |
|
149 |
"ADDR") |
|
150 |
"Bind address (default depends on cluster configuration)", |
|
151 |
OptComplInetAddr) |
|
142 | 152 |
|
143 | 153 |
oSyslogUsage :: OptType |
144 |
oSyslogUsage = Option "" ["syslog"] |
|
145 |
(reqWithConversion syslogUsageFromRaw |
|
146 |
(\su opts -> Ok opts { optSyslogUsage = Just su }) |
|
147 |
"SYSLOG") |
|
148 |
("Enable logging to syslog (except debug \ |
|
149 |
\messages); one of 'no', 'yes' or 'only' [" ++ C.syslogUsage ++ |
|
150 |
"]") |
|
154 |
oSyslogUsage = |
|
155 |
(Option "" ["syslog"] |
|
156 |
(reqWithConversion syslogUsageFromRaw |
|
157 |
(\su opts -> Ok opts { optSyslogUsage = Just su }) |
|
158 |
"SYSLOG") |
|
159 |
("Enable logging to syslog (except debug \ |
|
160 |
\messages); one of 'no', 'yes' or 'only' [" ++ C.syslogUsage ++ |
|
161 |
"]"), |
|
162 |
OptComplChoices ["yes", "no", "only"]) |
|
151 | 163 |
|
152 | 164 |
-- | Generic options. |
153 | 165 |
genericOpts :: [OptType] |
Also available in: Unified diff