mu: use new command-parser

This commit is contained in:
Dirk-Jan C. Binnema 2020-01-19 17:32:32 +02:00
parent c7680b78b9
commit c71f683e39
7 changed files with 1291 additions and 1680 deletions

View File

@ -42,42 +42,6 @@ cleanupnote:
tags:
gtags
# this warns about function that have a cyclomatic complexity of > 10,
# which is a sign that it needs some refactoring. requires the pmccabe
# tool. If all is fine, it outputs nothing
cc10:
@$(PMCCABE) `find . -name '*.c' -o -name '*.cc'` \
| grep -v mu-str-normalize.c \
| grep -v mu_str_subject_normalize \
| grep -v tests \
| sort -nr | awk '($$1 > 10)'
# this warns about functions that are over 35 non-comment lines long, which is a
# sign that they need some refactoring. requires the pmccabe tool. if
# all is fine, it outputs nothing
# note, some functions are exempted from this rule.
line35:
@$(PMCCABE) -c `find . -name '*.c' -o -name '*.cc'` \
| grep -v mu-str-normalize.c \
| grep -v mu_str_subject_normalize \
| grep -v config_options_group_find \
| grep -v SCM_DEFINE \
| grep -v tests \
| awk '($$5 > 35)'
# get all todo/fixme messages
fixme:
@grep -i 'FIXME\|TODO' `find src -type f`
# check whether we can run make distcheck from the repo version
gitcheck:
cd `mktemp -d`; \
git clone git://github.com/djcb/mu.git ; \
cd mu; \
autoreconf -i ; \
./configure ; \
make distcheck
EXTRA_DIST= \
TODO \
HACKING \

View File

@ -53,7 +53,7 @@ mu_SOURCES= \
mu-cmd-extract.c \
mu-cmd-find.c \
mu-cmd-index.c \
mu-cmd-server.c \
mu-cmd-server.cc \
mu-cmd-script.c \
mu-cmd.c \
mu-cmd.h
@ -66,7 +66,9 @@ mu-help-strings.h: mu-help-strings.txt mu-help-strings.awk
mu_LDADD= \
${top_builddir}/lib/libmu.la \
${top_builddir}/lib/utils/libmu-utils.la \
$(GLIB_LIBS) \
$(READLINE_LIBS) \
$(CODE_COVERAGE_LIBS)
EXTRA_DIST= \

File diff suppressed because it is too large Load Diff

1280
mu/mu-cmd-server.cc Normal file

File diff suppressed because it is too large Load Diff

View File

@ -173,6 +173,7 @@ MuError mu_cmd_tickle (MuStore *store, MuConfig *opts, GError **err);
* some error code otherwise
*/
MuError mu_cmd_server (MuStore *store, MuConfig *opts, GError**/*unused*/);
MuError mu_cmd_server2 (MuStore *store, MuConfig *opts, GError**/*unused*/);
/**
* execute the verify command (to verify signatures)

View File

@ -441,6 +441,8 @@ config_options_group_server (void)
GOptionEntry entries[] = {
{"maildir", 'm', 0, G_OPTION_ARG_FILENAME, &MU_CONFIG.maildir,
"top of the maildir", "<maildir>"},
{"list-commands", 0, 0, G_OPTION_ARG_NONE, &MU_CONFIG.list_commands,
"overwrite existing files (false)", NULL},
{NULL, 0, 0, 0, NULL, NULL, NULL}
};

View File

@ -1,7 +1,5 @@
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/
/*
** Copyright (C) 2008-2017 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** Copyright (C) 2008-2020 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** This program is free software; you can redistribute it and/or modify it
** under the terms of the GNU General Public License as published by the
@ -180,6 +178,10 @@ struct _MuConfig {
gboolean overwrite; /* should we overwrite same-named files */
gboolean play; /* after saving, try to 'play'
* (open) the attmnt using xdgopen */
/* for server */
gboolean list_commands; /* dump documentations for server
* commands */
/* options for mu-script */
gchar *script; /* script to run */
const char **script_params; /* parameters for scripts */