* [PATCH] Add --help to cogito 0.8
@ 2005-05-02 0:00 Alexander Beyn
2005-05-02 0:04 ` cg-log -r? Petr Baudis
0 siblings, 1 reply; 3+ messages in thread
From: Alexander Beyn @ 2005-05-02 0:00 UTC (permalink / raw
To: git
This patch adds -h and --help to all the cg- commands. It also moves the
detailed help printing from cg-help into cg-Xlib.
I created it because I could never remember if cg-log or cg-diff requires
the -r before the revs.
Alexander
Index: cg-Xlib
===================================================================
--- c3aa1e6b53cc59d5fbe261f3f859584904ae3a63/cg-Xlib (mode:100755 sha1:940d27851019940d20d2a6b141977d1c9a5debc0)
+++ d8f4221f90207b6c472dd4a2de0bf5e4d131f745/cg-Xlib (mode:100755 sha1:09668c5c9a02ff9df9957ce656db3358c8c1ca7f)
@@ -33,6 +33,17 @@
$(which mktemp) $dirarg $prefix"$1"
}
+print_help () {
+ which "cg-$1" >/dev/null 2>&1 || exit 1
+ cat $(which cg-$1) | sed -n '3,/^$/s/^# *//p'
+ exit
+}
+
+for option in "$@"; do
+ if [ "$option" = "-h" -o "$option" = "--help" ]; then
+ print_help ${_cg_cmd##cg-}
+ fi
+done
# Compatibility hacks:
# 2005-04-26
Index: cg-help
===================================================================
--- c3aa1e6b53cc59d5fbe261f3f859584904ae3a63/cg-help (mode:100755 sha1:d16446c005c4698f408bf651afd718d95f5a9cfe)
+++ d8f4221f90207b6c472dd4a2de0bf5e4d131f745/cg-help (mode:100755 sha1:0ea78197b1c255540a35bd389c48f9a67431e556)
@@ -10,9 +10,7 @@
if [ "$1" ]; then
cmd=$(echo "$1" | sed 's/^cg-//')
- which "cg-$cmd" >/dev/null 2>&1 || exit 1
- cat $(which cg-$cmd) | sed -n '3,/^$/s/^# *//p'
- exit
+ print_help $cmd
fi
^ permalink raw reply [flat|nested] 3+ messages in thread
* cg-log -r?
2005-05-02 0:00 [PATCH] Add --help to cogito 0.8 Alexander Beyn
@ 2005-05-02 0:04 ` Petr Baudis
2005-05-02 0:16 ` Alexander Beyn
0 siblings, 1 reply; 3+ messages in thread
From: Petr Baudis @ 2005-05-02 0:04 UTC (permalink / raw
To: Alexander Beyn; +Cc: git
Dear diary, on Mon, May 02, 2005 at 02:00:19AM CEST, I got a letter
where Alexander Beyn <malex-git@fatelectrons.org> told me that...
> I created it because I could never remember if cg-log or cg-diff requires
> the -r before the revs.
Actually, would you people hate me / Cogito / Richard Stallman if I
added -r to cg-log and cg-mkpatch, for the sake of consistency?
Extending cg-log to work on individual files would be then obvious.
P.S.: Yes, I'm back and hope to catch with the rest of you during tomorrow.
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: cg-log -r?
2005-05-02 0:04 ` cg-log -r? Petr Baudis
@ 2005-05-02 0:16 ` Alexander Beyn
0 siblings, 0 replies; 3+ messages in thread
From: Alexander Beyn @ 2005-05-02 0:16 UTC (permalink / raw
To: Petr Baudis; +Cc: git
On Mon, May 02, 2005 at 02:04:47AM +0200, Petr Baudis wrote:
> Dear diary, on Mon, May 02, 2005 at 02:00:19AM CEST, I got a letter
> where Alexander Beyn <malex-git@fatelectrons.org> told me that...
> > I created it because I could never remember if cg-log or cg-diff requires
> > the -r before the revs.
>
> Actually, would you people hate me / Cogito / Richard Stallman if I
> added -r to cg-log and cg-mkpatch, for the sake of consistency?
> Extending cg-log to work on individual files would be then obvious.
>
I'd welcome this change, but I still like the ubiquitous -h and --help
on all the commands
Alexander
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-05-02 0:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-02 0:00 [PATCH] Add --help to cogito 0.8 Alexander Beyn
2005-05-02 0:04 ` cg-log -r? Petr Baudis
2005-05-02 0:16 ` Alexander Beyn
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).