Skip to content

Commit

Permalink
Cleaning up version and usage statements.
Browse files Browse the repository at this point in the history
Slight clean-up of the version and usage statments to print
GPGME support using the HAVE_GPGME define.
  • Loading branch information
t-brown committed May 7, 2019
1 parent 670cf18 commit 0e409a1
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 32 deletions.
5 changes: 3 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

AC_PREREQ(2.61)
AC_INIT([mcds], [1.1], [[email protected]])
AC_INIT([mcds], [1.2], [[email protected]])
AC_CONFIG_AUX_DIR([build-aux])

# Define our M4 macro directory
Expand Down Expand Up @@ -63,7 +63,8 @@ AS_IF([test x$enable_gpgme != xno],
],
[AC_MSG_ERROR([GPGME not found])])
],
[AM_CONDITIONAL([WANT_GPGME], [test x = y])]
[AC_DEFINE(HAVE_GPGME, 0, [GPGME not supported])
AM_CONDITIONAL([WANT_GPGME], [test x = y])]
)

AC_OUTPUT
Expand Down
36 changes: 22 additions & 14 deletions po/mcds.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: mcds 1.1\n"
"Project-Id-Version: mcds 1.2\n"
"Report-Msgid-Bugs-To: <[email protected]>\n"
"POT-Creation-Date: 2019-05-07 13:52-0600\n"
"POT-Creation-Date: 2019-05-07 15:37-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"

#: src/carddav.c:94
msgid "Will not to write results to non-null pointer."
Expand Down Expand Up @@ -78,36 +79,37 @@ msgstr ""
msgid "Unable to finalise null curl handle."
msgstr ""

#: src/main.c:227
#: src/main.c:228
msgid "Must specify a term to query for."
msgstr ""

#: src/main.c:258
#: src/main.c:259
#, c-format
msgid ""
"usage: %s [-h] [-V] [-v] [-q n|t|e] [-s n|a|t|e] [-u URL] string\n"
"usage: %s [-h] [-V] [-v] [-q a|e|n|t] [-s a|e|n|t] [-u URL] string\n"
" -h, --help Display this help and exit.\n"
" -V, --version Display version information and exit.\n"
" -v, --verbose Verbose mode.\n"
" -q, --query n|t|e Query term (default name). Known terms are:\n"
" -q, --query a|e|n|t Query term (default name). Known terms are:\n"
" a = address\n"
" e = email\n"
" n = name\n"
" t = telephone\n"
" -s, --search a|n|e|t Search term (default email). Known terms are:\n"
" a = address\n"
" e = email\n"
" -s, --search a|t|e Search term (default email). Known terms are:\n"
" n = name\n"
" a = address\n"
" t = telephone\n"
" e = email\n"
" -u, --url The URL of the carddav server to query.\n"
" string The query string to look for within the query term.\n"
msgstr ""

#: src/main.c:285
#: src/main.c:287
#, c-format
msgid "%s (GNU %s) %s\n"
msgstr ""

#: src/main.c:286
#: src/main.c:288
#, c-format
msgid ""
"Copyright (C) %s Timothy Brown.\n"
Expand All @@ -118,13 +120,19 @@ msgid ""
"\n"
msgstr ""

#: src/main.c:291
#: src/main.c:293
#, c-format
msgid ""
"Compiled on %s at %s %s\n"
"Compiled on %s at %s %s GPGME support.\n"
"\n"
msgstr ""

#: src/main.c:294
msgid "with"
msgid_plural "with-out"
msgstr[0] ""
msgstr[1] ""

#: src/mem.c:60
#, c-format
msgid "out of memory (unable to allocate %ld bytes)"
Expand Down Expand Up @@ -165,7 +173,7 @@ msgid "Unable to build password file string"
msgstr ""

#: src/rc.c:205
msgid "Encrypted password files are not supportred."
msgid "Encrypted password files are not supportred, ignoring."
msgstr ""

#: src/vcard.c:83
Expand Down
2 changes: 1 addition & 1 deletion src/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/* Define if the GNU gettext() function is already present or preinstalled. */
#undef HAVE_GETTEXT

/* GPGME support */
/* GPGME not supported */
#undef HAVE_GPGME

/* Define if you have the iconv() function and it works. */
Expand Down
21 changes: 9 additions & 12 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <stdlib.h>
#include <errno.h>
#include <err.h>
#include <unistd.h>

#include <locale.h>
#include "gettext.h"
Expand Down Expand Up @@ -256,19 +257,20 @@ static void
print_usage(void)
{
printf(_("\
usage: %s [-h] [-V] [-v] [-q n|t|e] [-s n|a|t|e] [-u URL] string\n\
usage: %s [-h] [-V] [-v] [-q a|e|n|t] [-s a|e|n|t] [-u URL] string\n\
-h, --help Display this help and exit.\n\
-V, --version Display version information and exit.\n\
-v, --verbose Verbose mode.\n\
-q, --query n|t|e Query term (default name). Known terms are:\n\
-q, --query a|e|n|t Query term (default name). Known terms are:\n\
a = address\n\
e = email\n\
n = name\n\
t = telephone\n\
-s, --search a|n|e|t Search term (default email). Known terms are:\n\
a = address\n\
e = email\n\
-s, --search a|t|e Search term (default email). Known terms are:\n\
n = name\n\
a = address\n\
t = telephone\n\
e = email\n\
-u, --url The URL of the carddav server to query.\n\
string The query string to look for within the query term.\n\
"), program_name());
Expand All @@ -288,17 +290,12 @@ Copyright (C) %s Timothy Brown.\n\
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n\
This is free software: you are free to change and redistribute it.\n\
There is NO WARRANTY, to the extent permitted by law.\n\n"), "2019");
printf(_("Compiled on %s at %s %s\n\n"), __DATE__, __TIME__,
#ifdef HAVE_GPGME
"with GPGME support."
#else
"with-out GPGME support."
#endif
printf(_("Compiled on %s at %s %s GPGME support.\n\n"),
__DATE__, __TIME__, ngettext("with", "with-out", HAVE_GPGME)
);
exit(EXIT_FAILURE);
}


static const char *
program_name(void)
{
Expand Down
5 changes: 2 additions & 3 deletions src/rc.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ read_rc(void)
}

if (pfile) {
#ifdef HAVE_GPGME
#if HAVE_GPGME == 1
if (pfile[0] == '~' && pfile[1] == '/') {
len = strlen(home) + strlen(pfile);
abs_file = xmalloc(len*sizeof(char));
Expand All @@ -202,8 +202,7 @@ read_rc(void)
return(EXIT_FAILURE);
}
#else
warnx(_("Encrypted password files are not supportred."));
return(EXIT_FAILURE);
warnx(_("Encrypted password files are not supportred, ignoring."));
#endif

free(abs_file);
Expand Down

0 comments on commit 0e409a1

Please sign in to comment.