94{
95 if ((argc < 1) || !argv || !cli)
96 return false;
97
98
100 if (count > 0)
101 {
103 argc -= count;
104 argv += count;
105 }
106
107 bool rc = true;
108
109 opterr = 0;
110
111#if defined(BSD) || defined(__APPLE__)
112 optreset = 1;
113 optind = 1;
114#else
115 optind = 0;
116#endif
117
118 while (rc && (argc > 1) && (optind < argc))
119 {
120 int opt = getopt(argc, argv, "+:A:a:b:Cc:Dd:Ee:F:f:Gg:H:hi:l:m:nOpQ:RSs:TvyZz");
121 switch (opt)
122 {
123
124
125 case 'F':
126 {
129 break;
130 }
131 case 'n':
132 {
135 break;
136 }
137 case 'e':
138 {
141 break;
142 }
143 case 'm':
144 {
147 break;
148 }
149 case 'd':
150 {
153 break;
154 }
155 case 'l':
156 {
159 break;
160 }
161
162
163
164 case 'h':
165 {
166 if (optind < argc)
167 {
170 optind++;
171 }
174 break;
175 }
176 case 'v':
177 {
180 else
182
184 break;
185 }
186
187
188
189 case 'A':
190 {
192
195 break;
196 }
197 case 'D':
198 {
201 else
203
205 break;
206 }
207 case 'O':
208 {
211 break;
212 }
213 case 'Q':
214 {
216
219 break;
220 }
221 case 'S':
222 {
225 break;
226 }
227
228
229
230 case 'a':
231 {
233
236 break;
237 }
238 case 'b':
239 {
242 break;
243 }
244 case 'C':
245 {
248 break;
249 }
250 case 'c':
251 {
254 break;
255 }
256 case 'E':
257 {
260 break;
261 }
262 case 'H':
263 {
266 break;
267 }
268 case 'i':
269 {
272 break;
273 }
274 case 's':
275 {
278 break;
279 }
280
281
282
283 case 'f':
284 {
287 break;
288 }
289 case 'G':
290 {
293 break;
294 }
295 case 'g':
296 {
300 break;
301 }
302 case 'p':
303 {
306 break;
307 }
308 case 'R':
309 {
312 break;
313 }
314 case 'y':
315 {
318 break;
319 }
320 case 'Z':
321 {
324 break;
325 }
326 case 'z':
327 {
330 break;
331 }
332
333
334 case -1:
335 {
336 for (int i = optind; i < argc; i++)
337 {
339 }
341 optind = argc;
342 break;
343 }
344 default:
345 {
346 if (opt == '?')
348 else if (opt == ':')
350
353 rc = false;
354 break;
355 }
356 }
357 }
358
359 return rc;
360}
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
static int mop_up(int argc, char **argv, int index, struct StringArray *sa)
Eat multiple arguments.
int check_help_mode(const char *mode)
Check for help mode.
#define mutt_warning(...)
char * mutt_str_dup(const char *str)
Copy a string, safely.
bool version
-v Print version
bool license
-vv Print license
enum HelpMode mode
Display detailed help.
bool is_set
This struct has been used.
bool show_help
-O Show one-liner help
bool is_set
This struct has been used.
struct StringArray queries
-Q Query a config option
struct StringArray alias_queries
-A Lookup an alias
bool dump_config
-D Dump the config
bool dump_changed
-DD Dump the changed config
bool hide_sensitive
-S Hide sensitive config
struct Buffer draft_file
-H Use this draft file
bool is_set
This struct has been used.
struct Buffer include_file
-i Use this include file
struct StringArray cc_list
-c Add a Cc:
struct StringArray attach
-a Attach a file
bool use_crypto
-C Use CLI crypto
bool edit_infile
-E Edit the draft/include
struct StringArray bcc_list
-b Add a Bcc:
struct StringArray addresses
Send to these addresses.
struct Buffer subject
-s Use this Subject:
struct Buffer log_level
-d Debug log level
struct Buffer log_file
-l Debug log file
struct StringArray commands
-e Run these commands
bool is_set
This struct has been used.
bool disable_system
-n Don't read the system config file
struct StringArray user_files
-F Use these user config files
struct Buffer mbox_type
-m Set the default Mailbox type
bool read_only
-R Open Mailbox read-only
bool start_any_mail
-z Check for Any Mail
bool start_nntp
-G Open an NNTP Mailbox
struct Buffer nntp_server
-g Open this NNTP Mailbox
bool is_set
This struct has been used.
struct Buffer folder
-f Open this Mailbox
bool start_postponed
-p Open Postponed emails
bool start_new_mail
-Z Check for New Mail
bool start_browser
-y Open the Mailbox Browser
struct CliSend send
Send Mode command line options.
struct CliShared shared
Shared command line options.
struct CliHelp help
Help Mode command line options.
struct CliInfo info
Info Mode command line options.
struct CliTui tui
Tui Mode command line options.