From: "Jörg Sommer" <joerg@alea.gnuu.de>
To: zsh-workers@sunsite.dk
Subject: run-help: Support for svn and git
Date: Sun, 30 Dec 2007 19:19:49 +0000 (UTC) [thread overview]
Message-ID: <slrnfnfrql.cgh.joerg@alea.gnuu.de> (raw)
Hi,
calling run-help for svn or git is often not very helpful. svn has no
real information in the manpage and the infos for git blubb are in
git-blubb (not git). So, run-help should pay attention to the subcommand
for git and should call svn help subcommand |pager. My proposal:
#v+
--- /usr/share/zsh-beta/functions/Misc/run-help 2007-12-26 00:58:01.000000000 +0100
+++ /tmp/run-help 2007-12-30 20:18:37.530179261 +0100
@@ -12,8 +12,37 @@
: ${HELPDIR:=/usr/share/zsh-beta/help}
-[[ $1 == "." ]] && 1="dot"
-[[ $1 == ":" ]] && 1="colon"
+local subcmd
+subcmd=
+
+case $1 in
+ (.) 1=dot;;
+ (:) 1=colon;;
+ (git|sv[kn])
+ local full_cmd
+ builtin getln full_cmd
+ builtin print -z "$full_cmd"
+ local i
+ for i in ${(z)full_cmd#*$1}; do # remove VARIABLE=... $1
+ case "$i" in
+ (-*) ;;
+ (*)
+ case $1 in
+ (git)
+ if al=$(git config --get "alias.$i"); then
+ 1="git-${al%% *}"
+ else
+ 1="git-$i"
+ fi
+ ;;
+ (sv[kn]) subcmd=$i;;
+ esac
+ break
+ ;;
+ esac
+ done
+ ;;
+esac
if [[ $# == 0 || $1 == "-l" ]]
then
@@ -85,7 +114,11 @@
man zsh-betamisc
;;
(*)
+ if [[ -n "${subcmd:-}" ]]; then
+ ((! didman++)) && $1 help $subcmd | ${=PAGER:-/usr/bin/pager}
+ else
((! didman++)) && man $@
+ fi
;;
esac
if ((i < $#places && ! didman))
#v-
Would you include this change?
Bye, Jörg.
--
Es liegt in der Natur des Menschen, vernünftig zu denken und
unlogisch zu handeln! Das Gesagte ist nicht das Gemeinte und das Gehörte
nicht das Verstandene!
next reply other threads:[~2007-12-30 19:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-30 19:19 Jörg Sommer [this message]
2007-12-31 4:02 ` Bart Schaefer
2007-12-31 12:10 ` Jörg Sommer
2007-12-31 16:19 ` Bart Schaefer
2007-12-31 17:26 ` Jörg Sommer
2007-12-31 21:05 ` Bart Schaefer
2007-12-31 18:24 ` Jörg Sommer
2007-12-31 21:08 ` Bart Schaefer
2008-01-04 0:18 ` Clint Adams
2008-01-04 3:21 ` Bart Schaefer
2008-01-04 4:32 ` Clint Adams
2008-01-05 18:05 ` Bart Schaefer
2008-01-09 19:07 ` Clint Adams
2008-01-13 19:01 ` Bart Schaefer
2008-01-04 12:13 ` Jörg Sommer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=slrnfnfrql.cgh.joerg@alea.gnuu.de \
--to=joerg@alea.gnuu.de \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).