Commit 2229fcdc 2229fcdcea4cbd56de54afb70ebfca1cf352f9d0 by Sergey Poznyakoff

Re-introduce the --HANG hidden option.

* libmailutils/cli/cli.c (mu_common_options): Declare the --HANG
option.
(hangproc): New function.
1 parent eabddf8f
...@@ -160,7 +160,7 @@ config_verbose (struct mu_parseopt *po, struct mu_option *opt, ...@@ -160,7 +160,7 @@ config_verbose (struct mu_parseopt *po, struct mu_option *opt,
160 160
161 static void 161 static void
162 config_lint (struct mu_parseopt *po, struct mu_option *opt, 162 config_lint (struct mu_parseopt *po, struct mu_option *opt,
163 char const *arg) 163 char const *arg)
164 { 164 {
165 struct app_data *dp = po->po_data; 165 struct app_data *dp = po->po_data;
166 dp->lint = 1; 166 dp->lint = 1;
...@@ -183,11 +183,27 @@ param_set (struct mu_parseopt *po, struct mu_option *opt, char const *arg) ...@@ -183,11 +183,27 @@ param_set (struct mu_parseopt *po, struct mu_option *opt, char const *arg)
183 mu_cfg_tree_add_node (dp->append_tree, node); 183 mu_cfg_tree_add_node (dp->append_tree, node);
184 } 184 }
185 185
186 static void
187 hangproc (struct mu_parseopt *po, struct mu_option *opt, char const *arg)
188 {
189 int n;
190 if (mu_str_to_c (arg, mu_c_int, &n, NULL))
191 {
192 mu_parseopt_error (po, _("%s: bad number"), arg);
193 exit (po->po_exit_error);
194 }
195 mu_wd (n);
196 }
197
186 struct mu_option mu_common_options[] = { 198 struct mu_option mu_common_options[] = {
187 /* MU_OPTION_GROUP(N_("Common options")),*/ 199 /* MU_OPTION_GROUP(N_("Common options")),*/
188 { "program-name", 0, N_("NAME"), MU_OPTION_IMMEDIATE|MU_OPTION_HIDDEN, 200 { "program-name", 0, N_("NAME"), MU_OPTION_IMMEDIATE|MU_OPTION_HIDDEN,
189 N_("set program name"), 201 N_("set program name"),
190 mu_c_string, NULL, change_progname }, 202 mu_c_string, NULL, change_progname },
203 { "HANG", 0, N_("SECONDS"),
204 MU_OPTION_IMMEDIATE|MU_OPTION_ARG_OPTIONAL|MU_OPTION_HIDDEN,
205 N_("wait this number of seconds before startup"),
206 mu_c_string, NULL, hangproc, "3600" },
191 MU_OPTION_END 207 MU_OPTION_END
192 }; 208 };
193 209
......