From 714821b9d137479b8ddfe0f3611f68dfec91bf0f Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Tue, 12 Nov 2002 12:24:44 +0000 Subject: [w3m-dev 03414] Re: show parameter * main.c (fusage): add -show-option (MAIN): check -show-option From: Hironori SAKAMOTO --- ChangeLog | 8 +++++++- main.c | 13 ++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8cc6e0..7b7fbb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-11-12 Hironori SAKAMOTO + + * [w3m-dev 03414] Re: show parameter + * main.c (fusage): add -show-option + (MAIN): check -show-option + 2002-11-12 Hironori SAKAMOTO * [w3m-dev 03413] Re: setting form on loading @@ -4555,4 +4561,4 @@ a * [w3m-dev 03276] compile error on EWS4800 * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.500 2002/11/12 12:22:59 ukai Exp $ +$Id: ChangeLog,v 1.501 2002/11/12 12:24:44 ukai Exp $ diff --git a/main.c b/main.c index e63ccba..138d4aa 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.127 2002/11/11 15:33:36 ukai Exp $ */ +/* $Id: main.c,v 1.128 2002/11/12 12:24:44 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include @@ -239,6 +239,7 @@ fusage(FILE * f, int err) fprintf(f, " -title[=TERM] set buffer name to terminal title string\n"); fprintf(f, " -o opt=value assign value to config option\n"); + fprintf(f, " -show-option print all config options\n"); fprintf(f, " -config file specify config file\n"); fprintf(f, " -help print this usage message\n"); fprintf(f, " -version print w3m version\n"); @@ -654,10 +655,12 @@ MAIN(int argc, char **argv, char **envp) displayTitleTerm = getenv("TERM"); else if (!strncmp("-title=", argv[i], 7)) displayTitleTerm = argv[i] + 7; - else if (!strcmp("-o", argv[i])) { - if (++i >= argc || !strcmp(argv[i], "?")) { - show_params_p = 1; - usage(); + else if (!strcmp("-o", argv[i]) || + !strcmp("-show-option", argv[i])) { + if (!strcmp("-show-option", argv[i]) || ++i >= argc || + !strcmp(argv[i], "?")) { + show_params(stdout); + exit(0); } if (!set_param_option(argv[i])) { /* option set failed */ -- cgit v1.2.3