Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
+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[])
/* Wants: name = value */
static int
option_set_command(int argc, char *argv[])
+ 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")) {
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]);
Examples:
--------------------------------------------------------------------------
Examples:
--------------------------------------------------------------------------
+set show-author = yes # Show author?
+set show-date = yes # Show commit date?
set show-rev-graph = yes # Show revision graph?
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
set line-number-interval = 5 # Interval between line numbers
set tab-size = 8 # Number of spaces per tab
set encoding = "UTF-8" # Commit encoding