aboutsummaryrefslogtreecommitdiffstats
path: root/src/args.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/args.c')
-rw-r--r--src/args.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/args.c b/src/args.c
index 175c6b4..f920b8f 100644
--- a/src/args.c
+++ b/src/args.c
@@ -83,7 +83,7 @@ enum {
static void usage(void)
{
printf("%s\n", _("usage: calcurse [--daemon|-F|-G|-g|-i<file>|-Q|--status|-x[<format>]]\n"
- " [-c<file>] [-D<path>] [-h] [-q] [--read-only] [-v]\n"
+ " [-c<file>] [-C<file] [-D<path>] [-h] [-q] [--read-only] [-v]\n"
" [--filter-*] [--format-*]"));
}
@@ -120,6 +120,7 @@ static void help_arg(void)
putchar('\n');
printf("%s\n", _("Miscellaneous:"));
printf("%s\n", _(" -c, --calendar <file> Specify the calendar data file to use"));
+ printf("%s\n", _(" -C, --conf <file> Specify the configuration file to use"));
printf("%s\n", _(" --daemon Run notification daemon in the background"));
printf("%s\n", _(" -D, --directory <path> Specify the data directory to use"));
printf("%s\n", _(" -g, --gc Run the garbage collector and exit"));
@@ -404,17 +405,19 @@ int parse_args(int argc, char **argv)
int xfmt = IO_EXPORT_ICAL;
int dump_imported = 0, export_uid = 0;
/* Data file locations */
- const char *cfile = NULL, *datadir = NULL, *ifile = NULL;
+ const char *datadir = NULL;
+ const char *cfile = NULL, *ifile = NULL, *conffile = NULL;
int non_interactive = 1;
int ch;
regex_t reg;
- static const char *optstr = "FgGhvnNax::t::d:c:r::s::S:D:i:l:qQ";
+ static const char *optstr = "FgGhvnNax::t::C:d:c:r::s::S:D:i:l:qQ";
struct option longopts[] = {
{"appointment", no_argument, NULL, 'a'},
{"calendar", required_argument, NULL, 'c'},
+ {"conf", required_argument, NULL, 'C'},
{"day", required_argument, NULL, 'd'},
{"directory", required_argument, NULL, 'D'},
{"filter", no_argument, NULL, 'F'},
@@ -475,6 +478,9 @@ int parse_args(int argc, char **argv)
case 'c':
cfile = optarg;
break;
+ case 'C':
+ conffile = optarg;
+ break;
case 'd':
if (is_all_digit(optarg) ||
(*optarg == '-' && is_all_digit(optarg + 1))) {
@@ -720,7 +726,7 @@ int parse_args(int argc, char **argv)
else if (range < 0)
from = date_sec_change(to, 0, range);
- io_init(cfile, datadir);
+ io_init(cfile, datadir, conffile);
io_check_dir(path_dir);
io_check_dir(path_notes);