summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2014-08-06 16:26:17 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2014-08-06 16:26:45 +0200
commit9f24adfded95bb185887f96569754bf78b197044 (patch)
tree7e2aa5ca34ff451a159f529c9d67c87c3d3139fa /src
parent8ead883c321c1c16192e862585dab9c1c0b398c8 (diff)
downloadcalcurse-9f24adfded95bb185887f96569754bf78b197044.zip
args.c: Reword error messages
Use the same error message if option arguments have the same data type and always add the violating value. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src')
-rw-r--r--src/args.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/args.c b/src/args.c
index a2fbf81..17b3c10 100644
--- a/src/args.c
+++ b/src/args.c
@@ -529,55 +529,55 @@ int parse_args(int argc, char **argv)
case 'S':
case OPT_FILTER_PATTERN:
EXIT_IF(filter.regex,
- _("Can not handle more than one regular expression."));
+ _("cannot handle more than one regular expression"));
if (regcomp(&reg, optarg, REG_EXTENDED))
- EXIT(_("Could not compile regular expression."));
+ EXIT(_("could not compile regular expression: %s"), optarg);
filter.regex = &reg;
break;
case OPT_FILTER_START_FROM:
filter.start_from = parse_datearg(optarg);
EXIT_IF(filter.start_from == -1,
- _("invalid filter start date"));
+ _("invalid date: %s"), optarg);
break;
case OPT_FILTER_START_TO:
filter.start_to = parse_datearg(optarg);
EXIT_IF(filter.start_to == -1,
- _("invalid filter end date"));
+ _("invalid date: %s"), optarg);
break;
case OPT_FILTER_START_AFTER:
filter.start_from = parse_datearg(optarg) + 1;
EXIT_IF(filter.start_from == -1,
- _("invalid filter start date"));
+ _("invalid date: %s"), optarg);
break;
case OPT_FILTER_START_BEFORE:
filter.start_to = parse_datearg(optarg) - 1;
EXIT_IF(filter.start_to == -1,
- _("invalid filter end date"));
+ _("invalid date: %s"), optarg);
break;
case OPT_FILTER_END_FROM:
filter.end_from = parse_datearg(optarg);
EXIT_IF(filter.end_from == -1,
- _("invalid filter start date"));
+ _("invalid date: %s"), optarg);
break;
case OPT_FILTER_END_TO:
filter.end_to = parse_datearg(optarg);
EXIT_IF(filter.end_to == -1,
- _("invalid filter end date"));
+ _("invalid date: %s"), optarg);
break;
case OPT_FILTER_END_AFTER:
filter.end_from = parse_datearg(optarg) + 1;
EXIT_IF(filter.end_from == -1,
- _("invalid filter start date"));
+ _("invalid date: %s"), optarg);
break;
case OPT_FILTER_END_BEFORE:
filter.end_to = parse_datearg(optarg) - 1;
EXIT_IF(filter.end_to == -1,
- _("invalid filter end date"));
+ _("invalid date: %s"), optarg);
break;
case OPT_FILTER_PRIORITY:
filter.priority = atoi(optarg);
EXIT_IF(filter.priority < 1 || filter.priority > 9,
- _("invalid priority"));
+ _("invalid priority: %s"), optarg);
break;
case OPT_FILTER_COMPLETED:
filter.completed = 1;
@@ -587,15 +587,15 @@ int parse_args(int argc, char **argv)
break;
case OPT_FROM:
from = parse_datearg(optarg);
- EXIT_IF(from == -1, _("invalid start date"));
+ EXIT_IF(from == -1, _("invalid date: %s"), optarg);
break;
case OPT_TO:
to = parse_datearg(optarg);
- EXIT_IF(to == -1, _("invalid end date"));
+ EXIT_IF(to == -1, _("invalid date: %s"), optarg);
break;
case OPT_DAYS:
range = atoi(optarg);
- EXIT_IF(range == 0, _("invalid range"));
+ EXIT_IF(range == 0, _("invalid range: %s"), optarg);
break;
case OPT_FMT_APT:
fmt_apt = optarg;