Add a read-only option

We don't save any configuration nor items if this is set. This should be
used with care, and hence there's no short option for this.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2012-02-22 11:36:33 +01:00
parent f76e1cce40
commit 3bc9497fc8
7 changed files with 50 additions and 18 deletions

View File

@@ -51,7 +51,8 @@ enum {
OPT_FMT_RAPT,
OPT_FMT_EV,
OPT_FMT_REV,
OPT_FMT_TODO
OPT_FMT_TODO,
OPT_READ_ONLY
};
/*
@@ -665,6 +666,7 @@ parse_args (int argc, char **argv)
{"format-event", required_argument, NULL, OPT_FMT_EV},
{"format-recur-event", required_argument, NULL, OPT_FMT_REV},
{"format-todo", required_argument, NULL, OPT_FMT_TODO},
{"read-only", no_argument, NULL, OPT_READ_ONLY},
{NULL, no_argument, NULL, 0}
};
@@ -793,6 +795,9 @@ parse_args (int argc, char **argv)
case OPT_FMT_TODO:
fmt_todo = optarg;
break;
case OPT_READ_ONLY:
read_only = 1;
break;
default:
usage ();
usage_try ();