{"thread":{"id":"11827","subject":"[PATCH 2/4] help--browse: add '--config' option to check a config option for a browser.","startedAt":"2008-02-02T06:32:41Z","lastAt":"2008-02-02T06:32:41Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"67082","messageId":"20080202073241.925461ec.chriscool@tuxfamily.org","threadId":"11827","inReplyTo":null,"subject":"[PATCH 2/4] help--browse: add '--config' option to check a config option for a browser.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-02-02T06:32:41Z","receivedAt":"2008-02-02T06:32:41Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"The value of this new command line option will be used as a key to\ncheck the configuration for an help browser.\n\nThis should remove the last bit in 'git-help--browse' that was\nspecific to 'git-help', so that other git command can use\n'git-help--browse'.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n git-help--browse.sh |   23 ++++++++++++++++++-----\n help.c              |    2 +-\n 2 files changed, 19 insertions(+), 6 deletions(-)\n\ndiff --git a/git-help--browse.sh b/git-help--browse.sh\nindex 8189c08..9953e16 100755\n--- a/git-help--browse.sh\n+++ b/git-help--browse.sh\n@@ -16,7 +16,7 @@\n # git maintainer.\n #\n \n-USAGE='[--browser=browser|--tool=browser] url/file ...'\n+USAGE='[--browser=browser|--tool=browser] [--config=conf.var] url/file ...'\n \n # This must be capable of running outside of git directory, so\n # the vanilla git-sh-setup should not be used.\n@@ -53,6 +53,18 @@ do\n \t\t    shift ;;\n \t    esac\n \t    ;;\n+\t-c|--config*)\n+\t    case \"$#,$1\" in\n+\t\t*,*=*)\n+\t\t    conf=`expr \"z$1\" : 'z-[^=]*=\\(.*\\)'`\n+\t\t    ;;\n+\t\t1,*)\n+\t\t    usage ;;\n+\t\t*)\n+\t\t    conf=\"$2\"\n+\t\t    shift ;;\n+\t    esac\n+\t    ;;\n \t--)\n \t    break\n \t    ;;\n@@ -70,15 +82,16 @@ test $# = 0 && usage\n \n if test -z \"$browser\"\n then\n-    for opt in \"help.browser\" \"web.browser\"\n+    for opt in \"$conf\" \"web.browser\"\n     do\n+\ttest -z \"$opt\" && continue\n \tbrowser=\"`git config $opt`\"\n \ttest -z \"$browser\" || break\n     done\n     if test -n \"$browser\" && ! valid_tool \"$browser\"; then\n-\t    echo >&2 \"git config option $opt set to unknown browser: $browser\"\n-\t    echo >&2 \"Resetting to default...\"\n-\t    unset browser\n+\techo >&2 \"git config option $opt set to unknown browser: $browser\"\n+\techo >&2 \"Resetting to default...\"\n+\tunset browser\n     fi\n fi\n \ndiff --git a/help.c b/help.c\nindex b929899..058a397 100644\n--- a/help.c\n+++ b/help.c\n@@ -347,7 +347,7 @@ static void show_html_page(const char *git_cmd)\n \n \tget_html_page_path(&page_path, page);\n \n-\texecl_git_cmd(\"help--browse\", page_path.buf, NULL);\n+\texecl_git_cmd(\"help--browse\", \"-c\", \"help.browser\", page_path.buf, NULL);\n }\n \n void help_unknown_cmd(const char *cmd)\n-- \n1.5.4.rc5.25.g7a831-dirty\n"}]}