summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9256ab0)
raw | patch | inline | side by side (parent: 9256ab0)
author | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 6 Jun 2006 23:49:51 +0000 (01:49 +0200) | ||
committer | Jonas Fonseca Madsen <fonseca@ask.diku.dk> | |
Tue, 6 Jun 2006 23:49:51 +0000 (01:49 +0200) |
tig.c | patch | blob | history |
index c270e164e3cf158dfb8687b85f78974a602026c2..c0d888d9a261ab37e99436095513243f63148134 100644 (file)
--- a/tig.c
+++ b/tig.c
static bool config_errors;
static char *config_msg;
-/* Reads
- *
- * object fgcolor bgcolor [attr]
- *
- * from the value string. */
+/* Wants: object fgcolor bgcolor [attr] */
static int
-set_option_color(int argc, char *argv[])
+option_color_command(int argc, char *argv[])
{
struct line_info *info;
return OK;
}
+/* Wants: name = value */
+static int
+option_set_command(int argc, char *argv[])
+{
+ if (argc != 3) {
+ config_msg = "Wrong number of arguments given to set command";
+ return ERR;
+ }
+
+ if (strcmp(argv[1], "=")) {
+ config_msg = "No value assigned";
+ return ERR;
+ }
+
+ if (!strcmp(argv[0], "show-rev-graph")) {
+ opt_rev_graph = (!strcmp(argv[2], "1") ||
+ !strcmp(argv[2], "true") ||
+ !strcmp(argv[2], "yes"));
+ return OK;
+ }
+
+ if (!strcmp(argv[0], "line-number-interval")) {
+ opt_num_interval = atoi(argv[2]);
+ return OK;
+ }
+
+ if (!strcmp(argv[0], "tab-size")) {
+ opt_tab_size = atoi(argv[2]);
+ return OK;
+ }
+
+ if (!strcmp(argv[0], "encoding")) {
+ string_copy(opt_encoding, argv[2]);
+ return OK;
+ }
+
+ return ERR;
+}
+
static int
set_option(char *opt, char *value)
{
}
if (!strcmp(opt, "color"))
- return set_option_color(argc, argv);
+ return option_color_command(argc, argv);
+
+ if (!strcmp(opt, "set"))
+ return option_set_command(argc, argv);
return ERR;
}