doveadm.c revision 6565fc65b6c12eeab52dabfbe7c60cb10c219d1e
/* Copyright (c) 2009-2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "str.h"
#include "env-util.h"
#include "execv-const.h"
#include "master-service.h"
#include "master-service-settings.h"
#include "settings-parser.h"
#include "doveadm-print-private.h"
#include "doveadm-dump.h"
#include "doveadm-mail.h"
#include "doveadm-settings.h"
#include "doveadm.h"
#include <stdlib.h>
#include <unistd.h>
const struct doveadm_print_vfuncs *doveadm_print_vfuncs_all[] = {
};
{
}
static void
{
char **lines;
/* split lines */
/* sort lines */
/* print lines, compress subcommands into a single line */
for (i = 0; i < count; i++) {
args = "";
} else {
args++;
}
if (*prefix != '\0') {
continue;
}
if (p == NULL) {
if (*prev_name != '\0') {
prev_name = "";
}
} else {
if (*prev_name != '\0')
} else {
}
}
}
if (*prev_name != '\0')
}
static void ATTR_NORETURN
{
const struct doveadm_cmd *cmd;
if (*prefix != '\0')
exit(1);
}
void usage(void)
{
}
static void ATTR_NORETURN
{
exit(1);
}
{
}
{
const char *man_argv[3];
man_argv[0] = "man";
}
static struct doveadm_cmd doveadm_cmd_help = {
};
{
}
static struct doveadm_cmd doveadm_cmd_config = {
};
static bool
{
unsigned int len;
if (argc < 2)
return FALSE;
return FALSE;
/* more args */
}
return FALSE;
/* match */
return TRUE;
}
{
const struct doveadm_cmd *cmd;
unsigned int cmd_name_len;
return TRUE;
}
/* see if it matches a multi-word command */
return TRUE;
}
}
return FALSE;
}
static bool doveadm_has_subcommands(const char *cmd_name)
{
const struct doveadm_cmd *cmd;
return TRUE;
}
return doveadm_mail_has_subcommands(cmd_name);
}
static void doveadm_read_settings(void)
{
static const struct setting_parser_info *set_roots[] = {
};
struct master_service_settings_input input;
struct master_service_settings_output output;
const struct doveadm_settings *set;
const char *error;
}
static struct doveadm_cmd *doveadm_commands[] = {
};
{
const char *cmd_name;
unsigned int i;
bool quick_init = FALSE;
int c;
/* "+" is GNU extension to stop at the first non-option.
others just accept -+ option. */
while ((c = master_getopt(master_service)) > 0) {
switch (c) {
case 'D':
break;
case 'f':
break;
case 'v':
break;
default:
return FATAL_DEFAULT;
}
}
/* "help cmd" doesn't need any configuration */
quick_init = TRUE;
} else {
}
for (i = 0; i < N_ELEMENTS(doveadm_commands); i++)
/* special case commands: even if there is something wrong
with the config (e.g. mail_plugins), don't fail these
commands */
quick_init = TRUE;
} else {
quick_init = FALSE;
/* show usage after registering all plugins */
}
}
#ifdef __GLIBC__
/* for subcommands allow -options anywhere in command line */
optind = 0;
#else
optind = 1;
#endif
if (!doveadm_debug) {
/* disable debugging unless -D is given */
i_set_debug_file("/dev/null");
}
if (doveadm_has_unloaded_plugin(cmd_name)) {
i_fatal("Unknown command '%s', but plugin %s exists. "
"Try to set mail_plugins=%s",
}
usage();
}
if (!quick_init) {
}
return 0;
}