summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 482cce8)
raw | patch | inline | side by side (parent: 482cce8)
author | Christian Couder <chriscool@tuxfamily.org> | |
Sat, 2 Feb 2008 06:32:41 +0000 (07:32 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 5 Feb 2008 09:01:47 +0000 (01:01 -0800) |
The value of this new command line option will be used as a key to
check the configuration for an help browser.
This should remove the last bit in 'git-help--browse' that was
specific to 'git-help', so that other git command can use
'git-help--browse'.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
check the configuration for an help browser.
This should remove the last bit in 'git-help--browse' that was
specific to 'git-help', so that other git command can use
'git-help--browse'.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-help--browse.sh | patch | blob | history | |
help.c | patch | blob | history |
diff --git a/git-help--browse.sh b/git-help--browse.sh
index 88608bded1f6c8b325ce63ba7d177f77c7cd58fd..8ed489d8827f974b9a11ca5789a9fe3df9c9866b 100755 (executable)
--- a/git-help--browse.sh
+++ b/git-help--browse.sh
# git maintainer.
#
-USAGE='[--browser=browser|--tool=browser] url/file ...'
+USAGE='[--browser=browser|--tool=browser] [--config=conf.var] url/file ...'
# This must be capable of running outside of git directory, so
# the vanilla git-sh-setup should not be used.
shift ;;
esac
;;
+ -c|--config*)
+ case "$#,$1" in
+ *,*=*)
+ conf=`expr "z$1" : 'z-[^=]*=\(.*\)'`
+ ;;
+ 1,*)
+ usage ;;
+ *)
+ conf="$2"
+ shift ;;
+ esac
+ ;;
--)
break
;;
if test -z "$browser"
then
- for opt in "help.browser" "web.browser"
+ for opt in "$conf" "web.browser"
do
+ test -z "$opt" && continue
browser="`git config $opt`"
test -z "$browser" || break
done
if test -n "$browser" && ! valid_tool "$browser"; then
- echo >&2 "git config option $opt set to unknown browser: $browser"
- echo >&2 "Resetting to default..."
- unset browser
+ echo >&2 "git config option $opt set to unknown browser: $browser"
+ echo >&2 "Resetting to default..."
+ unset browser
fi
fi
index b929899e68d163da4e767ea042ab4e3855e17359..058a397534e82c0b4eab447ba827ef8cb1919320 100644 (file)
--- a/help.c
+++ b/help.c
get_html_page_path(&page_path, page);
- execl_git_cmd("help--browse", page_path.buf, NULL);
+ execl_git_cmd("help--browse", "-c", "help.browser", page_path.buf, NULL);
}
void help_unknown_cmd(const char *cmd)