summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2384880)
raw | patch | inline | side by side (parent: 2384880)
author | Dominik Vogt <dvogt@ffm.tc.iot.dtag.de> | |
Thu, 20 Mar 2008 15:41:16 +0000 (16:41 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 20 Mar 2008 17:59:54 +0000 (18:59 +0100) |
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
tig.c | patch | blob | history | |
tigrc.5.txt | patch | blob | history |
index 025a6f8547c163ccbec81c2764e149410cc1b52b..e5741d6125aefaa5c0897294c966a4eb699e7938 100644 (file)
--- a/tig.c
+++ b/tig.c
return OK;
}
+static bool parse_bool(const char *s)
+{
+ return (!strcmp(s, "1") || !strcmp(s, "true") ||
+ !strcmp(s, "yes")) ? TRUE : FALSE;
+}
+
/* Wants: name = value */
static int
option_set_command(int argc, char *argv[])
return ERR;
}
+ if (!strcmp(argv[0], "show-author")) {
+ opt_author = parse_bool(argv[2]);
+ return OK;
+ }
+
+ if (!strcmp(argv[0], "show-date")) {
+ opt_date = parse_bool(argv[2]);
+ return OK;
+ }
+
if (!strcmp(argv[0], "show-rev-graph")) {
- opt_rev_graph = (!strcmp(argv[2], "1") ||
- !strcmp(argv[2], "true") ||
- !strcmp(argv[2], "yes"));
+ opt_rev_graph = parse_bool(argv[2]);
+ return OK;
+ }
+
+ if (!strcmp(argv[0], "show-refs")) {
+ opt_show_refs = parse_bool(argv[2]);
+ return OK;
+ }
+
+ if (!strcmp(argv[0], "show-line-numbers")) {
+ opt_line_number = parse_bool(argv[2]);
return OK;
}
diff --git a/tigrc.5.txt b/tigrc.5.txt
index e73d7002ad9b454fa0884f4b33b771d41018e147..644ebc7dba52eb46d429c4a74b035f8ac352cd27 100644 (file)
--- a/tigrc.5.txt
+++ b/tigrc.5.txt
Examples:
--------------------------------------------------------------------------
+set show-author = yes # Show author?
+set show-date = yes # Show commit date?
set show-rev-graph = yes # Show revision graph?
+set show-refs = yes # Show references?
+set show-line-numbers = no # Show line numbers?
set line-number-interval = 5 # Interval between line numbers
set tab-size = 8 # Number of spaces per tab
set encoding = "UTF-8" # Commit encoding